You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add real veraPDF ISO 19005 PDF/A conformance validation tests - #297
Adds PdfFontVeraPdfTest along with strict detection, compression, and PDF/X regression coverage validating repaired, normalized, and compressed PDFs against real veraPDF ISO 19005 (PDF/A-1b, PDF/A-2b, PDF/A-3b) profiles. Provides independent standards-grade verification that font subsetting, normalization, and PDF/X conversion emit spec-compliant documents.
Changed:
Add PdfFontVeraPdfTest.java exercising veraPDF 1.30.0 1b, 2b, and 3b validation on repaired and subsetted outputs.
Expand PdfCompressorDetectionTest.java, PdfCompressorTest.java, and PdfXConverterTest.java with ISO conformance and compression-gate assertions.
Add PdfRepairStructuralDamageTest.java, PdfRepairTest, PdfFontEmbedderTest, and FontNormalizerTest conformance regressions.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Repair leaves signed PDFs unchanged when they can be opened, helping preserve their signatures.
Repair handles more malformed or truncated PDFs and reports failure when usable pages cannot be recovered.
Font embedding and normalization better preserve inherited Unicode mappings, correct font widths, and valid character-to-glyph information.
Lossless compression better preserves PDF/A structure and metadata.
Tests
Expanded coverage for PDF repair, compression, font embedding and normalization, and PDF/A conformance.
Added checks for metadata detection, color-space conversion, page boxes, and disallowed content.
The pull request changes PDF repair, font normalization, and font embedding behavior. It also adds tests for PDF/A detection and conformance, PDF compression, PDF repair, and PDF/X conversion.
Changes: Font normalization and embedding
Layer / File(s)
Summary
Normalize font programs and mappings native/bridge/include/jpdfium_font_internal.h, native/bridge/src/jpdfium_font_normalizer.cpp, native/bridge/src/jpdfium_font_shared.cpp, native/bridge/src/jpdfium_qpdf_fonts_subset.cpp, jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java
Normalization updates CID widths and CIDSet generation, repairs Type 1 lengths and CID system information, normalizes glyph names and symbolic flags, and adds cmap repair. Tests check width, CIDSet, and cmap behavior.
Audit fonts and update embedding jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontAuditor.java, jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java, native/bridge/src/jpdfium_qpdf_fonts_embed.cpp, native/bridge/src/jpdfium_qpdf_fonts_subset.cpp, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java
The auditor identifies visible and corrupt embedded fonts. The embedder checks visibility and codepoint coverage, adds script-specific fallbacks, and incorporates corrupt fonts into embedding results. Native embedding preserves inherited ToUnicode maps and reports embedded-program validity.
Check PDF/A font conformance jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontVeraPdfTest.java
VeraPDF tests check fixture, generated, and optional SafeDocs PDFs under selected PDF/A flavours. The test runner parses reports and selects font-related rules.
PDF repair
Layer / File(s)
Summary
Prepare inputs and preserve signed documents jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfRepair.java, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfRepairTest.java
Repair checks signed and password-blocked inputs, attempts empty-password decryption where applicable, and normalizes malformed object tokens and repeated resource keys before repair. Tests check that signed inputs remain unchanged.
Recover pages and validate repair output jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfRepair.java, native/bridge/src/jpdfium_repair.cpp, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfRepairStructuralDamageTest.java, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfRepairTest.java
Repair adds page-tree reconstruction and catalog-aware truncated-file salvage. It accepts salvage only when pages remain, rejects fixed output without pages, and compacts usable non-clean results. Tests cover malformed structures, page recovery, and encrypted input.
PDF compression
Layer / File(s)
Summary
Check PDF detection and compression jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorDetectionTest.java, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java
Tests cover single-quoted PDF/A attribute detection, Type1C and CID font subsetting, CID-to-GID remapping, and preservation of PDF/A-1 metadata and structure after compression.
Tests check conversion of shading and DeviceN colorants to CMYK, removal of embedded-file entries and actions, and page-box normalization.
Possibly related issues
Stirling-Tools/JPDFium#191: The issue discusses signature loss during PDF operations; this change adds repair handling that returns qualifying signed documents unchanged and fails closed for marked signed inputs that cannot be opened or have no pages.
Possibly related PRs
Stirling-Tools/JPDFium#231: This PR introduces the font-embedding path that this change modifies in Java and native code.
Stirling-Tools/JPDFium#233: This PR uses the font-embedding path, whose behavior changes here and whose output is covered by PDF/X conversion tests.
Change: Bug fix
Merge Risk: High · up to efe2b
This change rewrites how damaged PDFs are repaired and how fonts are normalized and embedded. Several new paths can silently alter documents. Repaired files can lose pages, page order, images, inherited page settings, or catalog features such as forms and outlines. Font repair can display the wrong glyphs, undo subsetting, or produce invalid font tables. Healthy CFF fonts can be treated as corrupt. Signed documents can also bypass requested sanitization while being reported as clean. These issues should be fixed before merging.
Pre-merge checks: 3 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Description check
The description states the PR is tests-only and lists the changed test files, but it does not cover the native and main-code changes that the raw summary attributes to this PR. Those include the bridg…
1. Clarify scope. State whether native bridge, main-code (PdfRepair, PdfFontAuditor, PdfFontEmbedder), and header changes belong to this PR. If they do, describe them. If they belong to PR #295 or earlier stack PRs, name those PRs and confi…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the main change: adding veraPDF-based PDF/A conformance validation tests. The changeset adds PdfFontVeraPdfTest, which validates outputs against PDF/A-1b, 2b, and 3b profiles. The titl…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: adding veraPDF-based PDF/A conformance validation tests. The changeset adds PdfFontVeraPdfTest, which validates outputs against PDF/A-1b, 2b, and 3b profiles. The title also omits the many font normalization and repair fixes, which is acceptable because the title need not cover every detail.
Full details: Description check
Explanation
The description states the PR is tests-only and lists the changed test files, but it does not cover the native and main-code changes that the raw summary attributes to this PR. Those include the bridge font normalizer, the SFNT cmap helpers, PdfRepair, PdfFontAuditor, and PdfFontEmbedder. The author says these moved to PR #295 and earlier stack PRs, yet the PR objectives describe the font normalization and repair changes as part of this PR. This conflict leaves the scope unclear. The checklist also leaves several items unchecked: the CHANGELOG entry, Javadoc for public members, and the header/ABI notes. The description does not link an issue, and the template asks for a 'Closes #(issue number)' line. Mostly complete, but scope and checklist gaps need resolution.
Resolution
Clarify scope. State whether native bridge, main-code (PdfRepair, PdfFontAuditor, PdfFontEmbedder), and header changes belong to this PR. If they do, describe them. If they belong to PR #295 or earlier stack PRs, name those PRs and confirm this diff contains only tests. 2. Add a 'Closes #(issue number)' line or state that no issue applies. 3. Check the CHANGELOG entry under '## [Unreleased]', or explain why it does not apply. 4. Address the unchecked Javadoc and ABI items. Check them, or explain why they do not apply. The raw summary lists no public API changes, so note that explicitly. 5. Reconcile the checked 'integrationTest passes' item with the test command in the Testing section, and state whether './gradlew test' was run.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
[warning] 44-46: Use a randomly-generated IV
Context: byte[] pdf = ("%PDF-1.7\n<rdf:Description pdfaid:part='1' "
+ "pdfaid:conformance='B'/>\n%%EOF")
.getBytes(StandardCharsets.ISO_8859_1);
Note: [CWE-329] Generation of Predictable IV with CBC Mode.
[warning] 474-477: Use a randomly-generated IV
Context: byte[] mapBytes = new byte[] {
0, 0,
(byte) ((targetGid >>> 8) & 0xFF), (byte) (targetGid & 0xFF)
};
Note: [CWE-329] Generation of Predictable IV with CBC Mode.
Save the PDF/A-1 fixture without object or xref streams.
doc.save(src.toFile()) uses PDFBox's default compression. In PDFBox 3.0.8 this writes object streams and an xref stream, so the fixture does not keep the PDF 1.4 classic structure that the test assumes. The later assertions about absent ObjStm and XRef objects therefore run against an input that already violates the premise. Save the fixture with CompressParameters.NO_COMPRESSION, and assert that the serialized input has no object or xref streams before compression runs.
set -u
echo"== QpdfLib.optimize body =="
sed -n '660,735p' jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java | cat -n
echo"== PdfOptimizer.optimize body =="
sed -n '48,72p' jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfOptimizer.java | cat -n
echo"== native validation and optimize_ex catch path =="
sed -n '336,360p' native/bridge/src/jpdfium_qpdf.cpp | cat -n
sed -n '446,478p' native/bridge/src/jpdfium_qpdf.cpp | cat -n
echo"== PdfDocument.saveBytes implementation =="
rg -n -F -- 'saveBytes' jpdfium/src/main/java/stirling/software/jpdfium/PdfDocument.java ||test"$?" -eq 1
Repository: Stirling-Tools/JPDFium
Length of output: 8039
Assert that the PDF/A-1 qpdf pass produced the output under test.
compress keeps the unoptimized document bytes when the qpdf pass returns nothing or does not shrink the output. The test checks only the output structure, so it can pass on that fallback. With the current PdfOptimizer.DEFAULT (-1) flags, the native optimizer can reject the input because -1 sets both the QDF and linearization bits. If the fallback bytes have no object or xref streams and an uncompressed metadata stream, the three assertions pass without the PDF/A-1 qpdf pass running.
Assert the qpdf action before reading the output. The compressor adopts qpdf output only when it is smaller, so the fixture must contain content the qpdf pass can shrink:
Suggested assertion
--- "a/jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java"+++ "b/jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java"@@ -601,7 +601,10 @@
.optimizeStreams(true)
.useZopfliDeflate(true)
.build());
+ assertTrue(res.result().actions().contains(+ "qpdf: recompressed streams (object streams disabled for PDF/A-1)"),+ "PDF/A-1 qpdf pass must produce the output");
try (PDDocument outDoc = Loader.loadPDF(res.bytes())) {
assertTrue(outDoc.getDocument()
.getObjectsByType(COSName.getPDFName("ObjStm")).isEmpty(),
"PDF/A-1 must not contain object streams");
Until the DEFAULT flags are corrected, this assertion can fail.
Committable suggestion
IMPORTANT
Review the replacement and indentation, then test before committing.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Apply the size limit before reading the PDF.
Line 169 loads the complete file before Line 170 applies the 5 MiB limit. An oversized corpus file can exhaust the test worker's heap instead of being skipped. Check the file size first and use a bounded read.
As per coding guidelines, “Flag unbounded readAllBytes.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Do not discard embedding failures.
If embedding throws for one selected PDF, this branch excludes that PDF from tested. Another successful PDF can then make the test pass. Fail with the input path and original exception, or collect the exception as a test failure.
As per coding guidelines, tests must have “No … swallowed failures.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '195,262p' jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontVeraPdfTest.java
Repository: Stirling-Tools/JPDFium
Length of output: 3899
Web query:
veraPDF PDF/A-2 rule 6.2.11.4.2 CIDSet applies to subset embedded CIDFonts only or all embedded CIDFonts, veraPDF 1.30 rule 6.3.5 CIDSet
Result:
Sources consulted:
- CIDSet, again — GitHub issue 811 in veraPDF/veraPDF-library (link omitted to avoid creating a cross-reference)
- Subset font question · Issue #907 · veraPDF/veraPDF-library — GitHub issue 907 in veraPDF/veraPDF-library (link omitted to avoid creating a cross-reference)
- preflight passes, veraPDF shows clause="6.2.11.4" error — GitHub issue 1019 in veraPDF/veraPDF-library (link omitted to avoid creating a cross-reference)
- Fix CIDSet / CharSet validation for PDF/A-1 — GitHub issue 983 in veraPDF/veraPDF-library (link omitted to avoid creating a cross-reference)
- TechNote 0010: Clarification of ISO 19005, parts 1-3 for developers of PDF/A creators and validators — https://pdfa.org/wp-content/uploads/2017/07/TechNote0010.pdf
Use a subset-tagged CIDFont fixture so the malformed CIDSet is checked under PDF/A-2b and 3b.
The fixture loads the font with embedSubset set to false, so the CIDFont has no subset tag on its BaseFont. For PDF/A-2b and PDF/A-3b, veraPDF checks CIDSet content only when that tag is present. The malformed CIDSet is therefore not flagged on this fixture, and the normalization assertions can pass with the CIDSet unchanged.
The fallback at line 232 has the same effect. When subsetFonts returns no PDF, the test validates the unsubsetted input and can pass without subsetting.
Make these changes in PdfFontVeraPdfTest:
Give the CIDFont BaseFont a six-uppercase-letter subset tag, for example ABCDEF+LiberationSans-Regular. Use a subset-tagged fixture for the malformed CIDSet case.
Assert that the malformed input fails the CIDSet rule under PDF/A-2b and PDF/A-3b before repair.
Assert that each repaired output passes the same rule.
Replace the fallback at line 232 with a failing assertion when subsetFonts returns no PDF, so the subset case must produce a subset output.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Dereference field entries before checking their type.
PDFBox 3.0.8 returns raw entries from COSArray.iterator(). An indirect signature field is a COSObject, so this condition skips the signature assertion. Use indexed getObject(i) access before inspecting /FT. Verify that the assertion rejects an output that retains an indirect signature field. (raw.githubusercontent.com)
As per path instructions, “tests should have observable expected outcomes.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Retain failures for references to .notdef.
Clause 6.2.11.8 prohibits references to .notdef in PDF/A-2 and PDF/A-3, including level B. This exclusion lets an output with that font violation satisfy the zero-violation assertions. Remove the blanket exclusion. If a fixture needs a validator workaround, restrict it to that fixture and the specific known failure. (github.com)
As per path instructions, “Enforce meaningful assertions.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Use a valid three-output tint transform.
With input 0.4, { 1 exch sub dup } leaves only two values, although /Range declares three. PDFBox 3.0.8 rejects this mismatch during evaluation. (raw.githubusercontent.com) The native converter appends RGB-to-CMYK instructions without checking the original output count, so structural assertions do not establish a usable result. (raw.githubusercontent.com)
Add the missing dup. Evaluate the input and converted tint transforms at a sample tint, and assert their expected component counts and values.
As per coding guidelines, tests need “an observable expected result” and must validate “representative rendering or text properties.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Check the persisted box coordinates without getter clipping.
PDFBox 3.0.8 clips getTrimBox() and getCropBox() to MediaBox. These assertions therefore pass even when conversion leaves both original out-of-range boxes unchanged. Correct handling of BleedBox does not detect that regression. (raw.githubusercontent.com)
Read the raw /TrimBox and /CropBox arrays from the page dictionary and compare their numeric coordinates. This makes the assertions verify normalization in the saved PDF.
As per path instructions, tests must have “observable expected outcomes.”
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Review details
Context from checks skipped due to timeout: 1
GitHub Check: CodeRabbit
Additional context used
Code guidelines: 1
.github/CODERABBIT_REVIEW.md — configured
Path-based instructions: 4
Apply the native ownership, C ABI, C++23, engine integration, memory, and SIMD rules from .github/CODERABBIT_REVIEW.md.
[warning] 413-413: Use a randomly-generated IV
Context: byte[] marker = "\n% /ByteRange [0 1 2 3]\n".getBytes(StandardCharsets.US_ASCII);
Note: [CWE-329] Generation of Predictable IV with CBC Mode.
The reason will be displayed to describe this comment to others. Learn more.
Major · Security & Privacy · Quick win
Reject incompatible sanitization requests instead of returning unsanitized success.
If an openable signed PDF contains JavaScript, embedded files or action annotations, sanitize(true) now returns CLEAN with the original bytes. This return bypasses PdfSecurity.sanitize. The same failure affects .all(), which enables sanitization.
Preserve the signature by returning an explicit failure for this incompatible request, or require an explicit policy that permits rewriting. Do not report successful sanitization without removing the requested content. Add a regression with an observable prohibited feature. As per coding guidelines, “Preserve stable public behavior.”
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Do not classify a raw /ByteRange occurrence as a signature.
The new test places /ByteRange in a comment in an unsigned PDF. This condition still treats that PDF as signed.
Append the same comment to the repairable zeroXref fixture. The guard returns either CLEAN with unchanged damaged bytes or FAILED, depending on whether PDFium opens it. Neither path attempts repair.
Confirm a signature structurally before disabling repair. Keep an unsigned-marker regression that expects repair to proceed. As per coding guidelines, “Preserve stable public behavior.”
Cover the setter guards with an explicit embed case.
inheritedToUnicodeBlocksCidSubstitution uses embedMissing. For a CID font without a program, prepareMissingCidMapping returns false on an inherited /ToUnicode, and the loop skips that font at line 898. The test therefore exits before setToUnicode or setCjkToUnicode runs. Removing the inheritance check from both setters leaves this test passing, and no other test exercises the setter guard for an inherited map.
Add an explicit PdfFontEmbedder.embed case for the same font, with an inherited /UseCMap base stream on /ToUnicode. The program must produce non-empty mappings. Both setters return on empty codes before the guard, so an empty case does not reach it. Assert that /ToUnicode still contains the base /UseCMap stream. Without the guard, the setter replaces that stream with a generated map, and the assertion fails.
Every defect fix needs a focused regression with an observable expected result, and this change currently lacks one for the setter guards.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Review details
Context from checks skipped due to timeout: 1
GitHub Check: CodeRabbit
Additional context used
Code guidelines: 1
.github/CODERABBIT_REVIEW.md — configured
Path-based instructions: 4
Apply the native ownership, C ABI, C++23, engine integration, memory, and SIMD rules from .github/CODERABBIT_REVIEW.md.
[warning] 742-742: Use a randomly-generated IV
Context: byte[] staleCidSet = new byte[] {(byte) 0x80, 0, 0, 0, 0x08, 0, 0x20};
Note: [CWE-329] Generation of Predictable IV with CBC Mode.
Bound format-4 cmap reads by the subtable's declared length.
cmapFitsProgram checks format-4 idRangeOffset lookups against the enclosing cmap table, not the subtable. A malformed format-4 subtable can therefore read the next subtable's bytes as glyph IDs. A nonzero value at or above maxGid makes the helper return false, and processFont then removes a valid /CIDSet on the non-resubsetted path. The format-4 length field at off + 2 is never read.
Limit the format-4 segment arrays and glyph-index reads to the subtable's declared end.
Suggested fix
--- "a/native/bridge/src/jpdfium_font_normalizer.cpp"+++ "b/native/bridge/src/jpdfium_font_normalizer.cpp"@@ -826,26 +826,27 @@
const uint16_t fmt = readU16BE(b + off);
if (fmt == 4 && cmapLen - rel >= 16) {
const uint16_t segX2 = readU16BE(b + off + 6);
const size_t segs = segX2 / 2;
+ const size_t subEnd = std::min<size_t>(off + readU16BE(b + off + 2), cmapOff + cmapLen);
const size_t ends = off + 14;
const size_t starts = ends + segX2 + 2;
const size_t deltas = starts + segX2;
const size_t ranges = deltas + segX2;
- if (ranges + segX2 > cmapOff + cmapLen) continue;+ if (ranges + segX2 > subEnd) continue;
for (size_t k = 0; k < segs; ++k) {
const uint16_t end = readU16BE(b + ends + k * 2);
const uint16_t start = readU16BE(b + starts + k * 2);
const uint16_t delta = readU16BE(b + deltas + k * 2);
const uint16_t range = readU16BE(b + ranges + k * 2);
if (start > end) continue;
for (uint32_t c = start; c <= end; ++c) {
uint32_t gid = 0;
if (range == 0) {
gid = (c + delta) & 0xFFFFU;
} else {
const size_t ro = ranges + k * 2 + range + (c - start) * 2;
- if (ro + 2 > cmapOff + cmapLen) continue;+ if (ro + 2 > subEnd) continue;
const uint16_t raw = readU16BE(b + ro);
if (raw == 0) continue;
gid = (raw + delta) & 0xFFFFU;
}
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '795,905p' native/bridge/src/jpdfium_font_normalizer.cpp
Repository: Stirling-Tools/JPDFium
Length of output: 5372
Read format-12 group fields from their own offsets.
In the format-12 branch, first and startGid use the wrong offsets. last at p + 4 is correct.
first reads p + 8, which is startGlyphID. It should read p, which holds startCharCode.
startGid reads p + 12. That is the next group's startCharCode, or bytes past the group array for the final group. It should read p + 8.
These errors have two effects:
For a multi-group table, startGid + (last - first) mixes a glyph ID with a character code. The result can reach maxGid, so cmapFitsProgram returns false. A valid font can then lose its existing /CIDSet.
For the final group, the p + 12 read covers four bytes past the group array. The guard at line 858 checks only groups * 12, so the read can pass the cmap table. If the cmap ends at the font-buffer end, the read leaves the buffer.
Add a regression test with a two-group format-12 cmap whose second group starts at a large character code. It should keep the CIDSet. Add a second test with the final group ending at the buffer boundary.
Suggested fix
--- "a/native/bridge/src/jpdfium_font_normalizer.cpp"+++ "b/native/bridge/src/jpdfium_font_normalizer.cpp"@@ -858,9 +858,9 @@
if (base + static_cast<size_t>(groups) * 12 > cmapOff + cmapLen) continue;
for (uint32_t g = 0; g < groups; ++g) {
const size_t p = base + static_cast<size_t>(g) * 12;
- const uint32_t last = readU32BE(b + p + 4);- const uint32_t first = readU32BE(b + p + 8);- const uint32_t startGid = readU32BE(b + p + 12);+ const uint32_t first = readU32BE(b + p);+ const uint32_t last = readU32BE(b + p + 4);+ const uint32_t startGid = readU32BE(b + p + 8);
(void)last;
if (first > last) continue;
if (startGid + (last - first) >= maxGid) return false;
Committable suggestion
IMPORTANT
Review the replacement and indentation, then test before committing.
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
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 Changes
Adds
PdfFontVeraPdfTestalong with strict detection, compression, and PDF/X regression coverage validating repaired, normalized, and compressed PDFs against real veraPDF ISO 19005 (PDF/A-1b, PDF/A-2b, PDF/A-3b) profiles. Provides independent standards-grade verification that font subsetting, normalization, and PDF/X conversion emit spec-compliant documents.Changed:
PdfFontVeraPdfTest.javaexercising veraPDF 1.30.01b,2b, and3bvalidation on repaired and subsetted outputs.PdfCompressorDetectionTest.java,PdfCompressorTest.java, andPdfXConverterTest.javawith ISO conformance and compression-gate assertions.PdfRepairStructuralDamageTest.java,PdfRepairTest,PdfFontEmbedderTest, andFontNormalizerTestconformance regressions.Checklist
General
## [Unreleased]inCHANGELOG.mdLibrary changes
.github/workflows/compatibility.ymlexcludes the break with a reasondocs/installation.md, and the POMsNative or FFM changes
bash native/build-real.sh)./gradlew :jpdfium:integrationTestnative/bridge/include/jpdfium.hand the ABI notes for any ABI changeTesting
./gradlew :jpdfium:integrationTestpasses