Standards and print
A PDF from Lpdf is a plain PDF until the document asks for more. The output element of the document turns on each PDF standard, encryption and fast web view, and a few attributes elsewhere handle print: bleed, print-only content and the color of the inks. This page says what each is for, who asks for it and what turns it on, which one fits which job, and where every other area of Lpdf is documented.
The standards
Section titled “The standards”Each is set in the output element, and a document that sets none of them gives a plain PDF. A document can set several: Combinations says which go together and which are refused.
| Standard | What it is for | Who asks for it | Turned on with | Page |
|---|---|---|---|---|
| PDF/A | A file that looks the same decades from now, with every font in it | Archives, courts, public bodies and banks | <output pdfa="2u"/>, or another of 2a, 2b, 3a, 3b, 3u |
PDF/A |
| Factur-X and ZUGFeRD | An e-invoice: a PDF/A-3 file whose pages are the invoice people read, carrying the same invoice as XML that accounting software reads | Businesses that send invoices to customers in France and Germany | A file named factur-x.xml or xrechnung.xml in the attachments of a PDF/A-3 document |
Factur-X / ZUGFeRD |
| PDF/UA | A tagged PDF that a screen reader can read | Anyone bound by accessibility law, such as the European Accessibility Act, for the statements, invoices and tickets a system generates | <output pdfua="1"/> |
PDF/UA |
| PDF/X | A file for a commercial printer: what the press prints, tied to the printer’s color profile | Printers | <output pdfx="4" profile="press"/> |
PDF/X |
| Encryption | An open password, an owner password and permissions for printing, copying and editing | Anyone who sends a document that only its reader may open, such as a statement with the customer’s own password | <output encrypt="aes-256" allow="print"/>, or encrypt="rc4-128" for readers that cannot open AES-256 |
Encryption |
| Fast web view | A file a browser shows page by page while it is still downloading | Large documents read in a browser, such as statements, catalogues, reports and books | <output linearize="true"/> |
Fast web view |
For print
Section titled “For print”A job for a printer uses these as well as PDF/X, and each also works in a plain PDF.
| What | What it does | Turned on with | Page |
|---|---|---|---|
| CMYK and spot colors | Writes a color as the press’s inks, or as an ink of its own | cmyk(0, 85, 100, 0), or a spot color declared in tokens |
Color and print |
| Bleed | Each page reaches past its trim edge, so a background runs to the cut | bleed="3mm" on the document or a section |
PDF/X, bleed |
| Print and screen content | Content that shows only on screen, or only on paper | ocg="print" or ocg="screen" on an element |
Print and screen content |
Which standard fits which job
Section titled “Which standard fits which job”- Keep a document for years. Write PDF/A.
pdfa="2u"keeps the look of every page and lets the text be searched and copied,2bkeeps the look only, and2aalso tags the file for screen readers. Part 3 (3a,3b,3u) is the same with attachments of any kind. The render gives the file its date ascreatedOn. - Send an e-invoice to a customer in France or Germany. Write a PDF/A-3 document and attach the invoice’s XML as
factur-x.xml, or asxrechnung.xmlfor the XRechnung profile. Lpdf reads the profile from the XML, which is one of MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED and XRECHNUNG, and writes the Factur-X metadata. It checks nothing else in the XML: the invoice’s content is yours to check. - Make a file a screen reader can read. Write
pdfua="1", givemetaatitleand alang, and give every image and barcode analt. It goes with PDF/A, PDF/X and linearization, and with encryption whenallownamesaccessibility. - Send a file to a printer. Write
pdfx="4"with the printer’s press profile, andbleedas the printer asks: most printers ask for 3mm. CMYK colors and spot colors stay the printer’s inks. A PDF/X file can’t be encrypted, can’t be PDF/A and carries no attachments. - Let only the readers who have a password open a file. Write
encrypt="aes-256"and give the passwords with the render call. A file can’t be encrypted and PDF/A, or encrypted and PDF/X. - Show a large file at once in a browser. Write
linearize="true". It goes with every other setting. A one-page document gains nothing from it. - Show some content only on screen, or only on paper. Put
ocg="screen"orocg="print"on the element. In a PDF/A or PDF/UA file everything shows, and a PDF/X file is the print version.
A job that needs none of these is a plain PDF: leave output out.
Everything else Lpdf does
Section titled “Everything else Lpdf does”The other areas, and the page that covers each:
- Images: which formats an image reads and which it refuses, and how an SVG is drawn: Image, formats.
- Color: hex,
rgb(),hsl(),cmyk(), spot colors and gradients: Color and print, and XML Schema, colors. - Fonts and text: the built-in fonts, TrueType, OpenType and variable fonts, and the text elements: Installation, images and fonts, Text and Markdown.
- Layout: sections, page sizes, boxes, tables, lists, headers, footers and page numbers: Section, Layout, Table and List.
- Barcodes: the types and what each takes as data: Barcode.
- Forms: fillable fields: Field.
- Graphics: layers, shapes, shadows and ruled pages: Layer, Shape and XML Schema, rulings.
- Attachments: files carried inside the PDF: Attachments.
- Stamping existing PDFs: images drawn over the pages of a PDF Lpdf did not make: Stamping existing PDFs.
- Merging PDFs for print: existing PDFs, merged into one made for printing: Merging PDFs for print.
- Data binding: filling a document from JSON, and records by the hundreds of thousands: Data binding and Bulk records.
- Bookmarks, page labels and metadata: Bookmark, Section, page numbers and All elements, meta.
- Render limits: time and memory: Installation, time limit and memory limit.
The complete list, with the version each feature came in and where each stops, is FEATURES.md in the Lpdf repository.