Print & Document Generation Lab
Twenty working examples (features 351-370) of printing and generating documents with Spring Boot 3.5, Spring Data JPA and SQL Server: PDF, Excel, Word, barcodes, QR codes, labels, receipts, invoices, certificates, templates, batch printing, e-mail, digital signatures, watermarks and full page setup.
16Invoices in SQL Server
6Receipts
6Certificates
116Documents generated / printed
Preview & print
351
Print Preview
See the page exactly as it will print - HTML paper view and PDF view.
352
Print to Printer
List this PC's printers and print from the server, or print in the browser.
363
Batch Print
Pick many documents and get one merged PDF or a ZIP - or send them to a printer.
Generate files
353
Generate PDF
Build a multi-page PDF report from SQL Server data with OpenPDF.
354
Generate Excel Report
Styled .xlsx with formulas, filters, frozen header and Excel print setup.
355
Generate Word Document
Quotation / invoice / reminder letters as .docx with page fields.
Codes
356
Generate Barcode
Code 128, Code 39 and EAN-13 as PNG or SVG with ZXing.
357
Generate QR Code
QR codes for URLs, Wi-Fi, contacts and payments, with error correction.
Business documents
358
Label Printing
Product and address labels on A4 sheets, label rolls or 4 x 6 shipping labels.
359
Receipt Printing
80 mm / 58 mm thermal receipts and recording payments.
360
Invoice Printing
A4 invoices with VAT, QR code, barcode and signature lines.
361
Certificate Generation
Landscape certificates in three styles, bulk issue and QR verification.
362
Custom Template Printing
Write your own document template with {{fields}} and print it.
Share & secure
364
Email Document
Attach any document to an e-mail (Outbox .eml or real SMTP).
365
Digital Signature
Sign PDFs with an X.509 certificate and verify signatures.
366
Watermark on Document
Stamp DRAFT / COPY / CONFIDENTIAL on any PDF.
Page setup
367
Page Number on Print
"Page 3 of 12" in any position and format.
368
Header/Footer on Print
Company name, title and print date on every page.
369
Print Orientation
Portrait or landscape - same report, different layout.
370
Print Paper Size Selection
A3, A4, A5, Letter, Legal... saved as reusable presets.
Recent print jobs
All history| Feature | Document | Type | When |
|---|---|---|---|
| 356 | CODE_128: null | SVG | 7 Nov 02:13 |
| 356 | CODE_128: PD-2026-000351 | PNG | 6 Nov 22:53 |
| 354 | Sales report (16 invoices) | EXCEL | 6 Nov 21:23 |
| 360 | Invoice INV-202609-003 | PDF preview | 6 Nov 00:26 |
| 356 | CODE_128: PD-2026-000351 | SVG | 6 Nov 00:15 |
| 360 | Invoice INV-202609-006 | PDF preview | 5 Nov 18:49 |
| 360 | Invoice INV-202608-002 | PDF preview | 5 Nov 18:16 |
| 361 | Certificate CERT-2026-0001 | CERTIFICATE | 5 Nov 17:50 |
How this project is built
| Web | Spring MVC + Thymeleaf pages, plain CSS and a little JavaScript |
| Database | SQL Server PrintDocLabDB - JPA entities, Flyway migration V1__schema.sql |
| OpenPDF (create), PDFBox (print, sign), Bouncy Castle (CMS signature) | |
| Office | Apache POI - XSSF for Excel, XWPF for Word |
| Codes | ZXing - Code 128, Code 39, EAN-13, QR |
| Printing | javax.print + java.awt.print.PrinterJob, CSS @media print / @page |
| Spring Mail (Jakarta Mail) - Outbox .eml or SMTP |
Every page has a yellow How it works box with the classes and code to study. The README.md in the project folder maps every feature to its source files.