Repository navigation
feat(pdf): embed Unicode font and image objects in signed XObjects - #35
Merged
Merged
Conversation
Share the Unicode font object serialization with destination-owned PDF object allocators. Materialize Type0 fonts, ToUnicode, CIDToGIDMap, PNG soft masks and SVG XObjects for signed appearance dictionaries. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Exercise PDF object references, glyph/ToUnicode maps, transparent PNG soft masks, SVG XObjects, invalid resources, multi-resource scenarios, and strict reference validation with data providers. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Avoid recompressing PNG image and soft-mask streams when materializing resources in a SignerPHP document. Verify decoded pixel bytes and stream lengths for transparent, grayscale and RGB PNGs. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Cast stream bytes explicitly for strlen() in PNG resource regression tests. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Restore the destination document object table and allocator on failure. Reject null internal font and image placeholders instead of emitting them. Cover failure after a valid font and successful retry on the same document. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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.
Context
Follow-up to merged #34 for #33. The standalone PDF preview already writes Type 0 fonts, but the signed-PDF resource contract needs document-owned indirect objects. Depends on SignerPHP/pdf-core#5 (optional appearance resource builder); do not merge until that foundation is released and the consumer uses it.
Change
UnicodeFontPdfWriterwith callbacks allocated by the targetSignerPHP\\PdfCore\\PdfDocument.SignerPhpCoreXObjectResourceBuilder::resourcesBuilder()materializes Type0/CIDFontType2, embeddedFontFile2,CIDToGIDMap,ToUnicodeand actualPDFValueReferenceobjects instead of internal__TrueTypeFontarrays.signerphp/pdf-core:^0.1.2; consumers supply the compatible core package.Validation (local, Poland)
3a8380b.SignerPhpCoreXObjectResourceBuilder(81/81 killed after rollback and stream fixes) and changedUnicodeFontPdfWriter(99/99 killed).1f55bbcand pdf-signer main12031a0passed SignerPHP validation and independent Popplerpdfsigintegrity validation; Poppler and MuPDF rendered and extracted multilingual signature appearance text.Remaining scope of #33
This PR does not implement Arabic/Hebrew bidi/OpenType shaping, font subsetting or final signed-PDF compatibility across released versions. Do not close #33 with this PR.
Refs #33; depends on SignerPHP/pdf-core#5.