Repository navigation
Support PDF/X-4 for print production - #1809
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 28 |
| Duplication | 1 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
andreasrosdal
force-pushed
the
pdfx4-support
branch
from
December 2, 2026 21:41
23d516d to
b9403f6
Compare
PDF/X-4 (ISO 15930-7:2010) is the current exchange format for print production. Unlike PDF/X-1a and PDF/X-3, which OpenPDF already supports, it allows transparency, layers and ICC based colour. - PdfWriter.PDFX4 writes the document as PDF 1.6. - Transparency, soft masks and layers are allowed, as for PDF/A-2 and PDF/A-3. Fonts must still be embedded and encryption is refused. - The info dictionary gets /GTS_PDFXVersion (PDF/X-4), /Trapped and, for every PDF/X level, the /ModDate that PDF/X requires. - The XMP metadata is created when the document is closed, unless it was set before. For PDF/X-4 it has pdfxid:GTS_PDFXVersion, xmpMM:DocumentID, VersionID and RenditionClass, xmp:MetadataDate and pdf:Trapped. - An output intent with an ICC profile is required. Closing the document without one throws a PdfXConformanceException. Co-Authored-By: Claude Opus 5.5 <[email protected]>
andreasrosdal
force-pushed
the
pdfx4-support
branch
from
December 2, 2026 21:48
b9403f6 to
cd7d9ac
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description of the new Feature/Bugfix
Adds PDF/X-4 (ISO 15930-7:2010), the current exchange format for print production. Printing presses and prepress workflows ask for it, and it is the default PDF/X profile in Acrobat, InDesign and Ghostscript. OpenPDF supported only PDF/X-1a:2001 and PDF/X-3:2002, which forbid transparency and layers.
Usage
What OpenPDF does for
PDFX4setPDFXConformance(PDFX4)sets the version to 1.6GTS_PDFXwith an embedded ICC profilePdfXConformanceException. PDF/X-1a and PDF/X-3 still get the default SWOP intent without a profile.TrimBoxorArtBoxon every page/GTS_PDFXVersion (PDF/X-4),/Trapped,/Title,/CreationDate,/ModDate/ModDatewas missing for every PDF/X level and is now added.pdfxid:GTS_PDFXVersion,xmpMM:DocumentID,xmpMM:VersionID,xmpMM:RenditionClass,pdf:Trapped,xmp:CreateDate,xmp:ModifyDate,xmp:MetadataDate,dc:titlecreateXmpMetadata(), whichclose()calls for PDF/X-4 if no metadata was setLimitations
DeviceRGBwith a CMYK output intent. Users need ICC based or CMYK colour for a CMYK printing condition.Other changes
XmpWriterwritespdf:Trappedwhen the info dictionary has/Trapped(new constantPdfSchema.TRAPPED).PdfWriter.isPdfX4()andPdfXConformanceImp.isPdfX4().Unit-Tests for the new Feature/Bugfix
New
PdfX4Test:%PDF-1.6header, the info entries, every required XMP property, theGTS_PDFXoutput intent withDestOutputProfile, aTrimBox, no encryption./Trappedthat the user set are kept../mvnw -B installpasses locally on Java 25 for all modules, andcheckstyle:checkreports nothing on the changed files. The changelog for 4.0.1 is updated.