Skip to content

Repair CIDSet, widths, and CFF/PDF/X font handling in native bridge - #261

Open
balazs-szucs wants to merge 1 commit into
refactor/font-14-compress-verifyfrom
refactor/font-15-compress-repair
Open

balazs-szucs wants to merge 1 commit into
refactor/font-14-compress-verifyfrom
refactor/font-15-compress-repair

Conversation

@balazs-szucs

@balazs-szucs balazs-szucs commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Description of Changes

Repairs /CIDSet streams, CID /W width arrays, CFF extraction, and PDF/X pattern/font invariants inside the native C++ bridge. Separating width calculation from descriptor mutation and fixing inline tiling-pattern dictionary checks prevents corrupt output on edge-case PDFs.

Changed:

  • Synchronize /CIDSet bitmasks, /W widths, and CFF re-subsetting in jpdfium_advanced.cpp and jpdfium_qpdf.cpp.
  • Unwrap stream dictionaries when inspecting/clamping tiling pattern steps and PDF/X resources in jpdfium_pdfx.cpp and jpdfium_qpdf.cpp.
  • Update QpdfLib.java FFM declarations to expose native subsetting diagnostics.

Checklist

General

  • I have read the Contributing Guide
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Notable user-facing changes are recorded under ## [Unreleased] in CHANGELOG.md

Library changes

  • Javadoc covers any new or changed public type or member
  • Public API changes are additive, or .github/workflows/compatibility.yml excludes the break with a reason
  • Version references stay consistent across the README, docs/installation.md, and the POMs

Native or FFM changes

  • Rebuilt the bridge at the stack tip (bash native/build-real.sh)
  • Ran ./gradlew :jpdfium:integrationTest
  • Updated native/bridge/include/jpdfium.h and the ABI notes for any ABI change

Testing

  • Added or updated tests that cover the change
  • ./gradlew :jpdfium:integrationTest passes

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 367b8c8 and a965a25.

Files selected for processing: 4

  • jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java
  • native/bridge/src/jpdfium_advanced.cpp
  • native/bridge/src/jpdfium_pdfx.cpp
  • native/bridge/src/jpdfium_qpdf.cpp
Summary

Summary by CodeRabbit

  • New Features

    • Added a strict font-embedding option that reports fonts that could not be embedded.
    • Expanded font character coverage and improved handling of Unicode text.
  • Bug Fixes

    • Font normalization now repairs incorrect character widths and coverage information, helping preserve text appearance and extraction.
    • Font subsetting is off by default and is accepted only when the result passes checks for page count, text, and visual output.
    • Improved handling of malformed PDF patterns and inline images during processing.

The pull request changes Java compression and font-embedding behavior, native font normalization and subsetting, and native handling of tiling-pattern step values. It adds checks and tests for PDF validity, extracted text, rendered output, font metadata, and unresolved fonts.

Changes: Font handling

Layer / File(s) Summary
Compression controls and verification
jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressOptions.java, CompressPreset.java, PdfCompressor.java, jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java, CHANGELOG.md
Font subsetting is now opt-in, all presets disable Zopfli, and compression adopts a subsetted candidate only after validity, text, and rendering checks. Tests cover the defaults and pixel-identical output.
Font embedding and audit checks
jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java, PdfFontAuditor.java, jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java, PdfFontEmbedderRoundTripTest.java, jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontCoverageTest.java, CHANGELOG.md
The Java API adds strict checks for unresolved fonts and validates font collection, symbolic-name, and cmap data. Audits now fail when a page cannot be opened. Tests check embedding failures, text, rendering, and subset-font use.
Native CID width and CIDSet repair
native/bridge/src/jpdfium_advanced.cpp, jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java, CHANGELOG.md
Normalization repairs CID /W widths and rebuilds /CIDSet from embedded-font mappings. Inline-image terminator recognition and subset output flags also change. Regression tests cover repaired widths, CIDSet coverage, and extracted text.
Native font discovery and subsetting
native/bridge/src/jpdfium_qpdf.cpp, jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java, CHANGELOG.md
Native font processing changes content scanning, glyph mapping, /Widths, /ToUnicode, /CharSet, and /CIDSet handling. It traverses form and nested XObject resources, isolates failures per font, and changes the CFF fallback and no-qpdf stub.
Font normalization regression coverage
jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java
Tests now expect CIDSet to cover the embedded program and check width repair and text extraction on issue20065.pdf.

Tiling-pattern step normalization

Layer / File(s) Summary
Pattern step clamping
native/bridge/src/jpdfium_pdfx.cpp, native/bridge/src/jpdfium_qpdf.cpp
Both native resource paths normalize invalid or excessive tiling-pattern /XStep and /YStep values. The qpdf path also traverses annotation appearances, nested XObjects, and Type 3 font resources.

Possibly related PRs

Change: Bug fix

Merge Risk: Moderate · previous review 367b8

The pattern-step handling can alter the rendering of valid PDFs while leaving malformed stream patterns untouched. A crafted PDF can hang the opt-in font-subsetting path. Font repair can drop embedded programs or widths in edge cases. These should be fixed before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the template structure and most required items are checked. Two gaps remain. First, the CHANGELOG.md entry is unchecked, yet the raw summary shows CHANGELOG.md was updated with… 1. Check the CHANGELOG.md item, or explain why the Unreleased entries do not apply. 2. Add a 'Changed' bullet for each public or behavior change: CompressOptions.Builder subsetFonts default now false; CompressPreset useZopfliDeflate now fal…
Passed Passed checks: 3 passed

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the native bridge font work: CIDSet repair, /W widths, and CFF/PDF/X font handling. The changeset covers these areas, including CIDSet and /W repair in jpdfium_advanced.cpp and jpdfium…
Full details: Title check

Explanation

The title names the native bridge font work: CIDSet repair, /W widths, and CFF/PDF/X font handling. The changeset covers these areas, including CIDSet and /W repair in jpdfium_advanced.cpp and jpdfium_qpdf.cpp, and CFF handling for pre-1.6 PDFs. It does not mention the Java compression defaults, strict embedding, or the Type3 pattern clamping, which are also large parts of the change. The title is specific and accurate, but it is not a full summary.

Full details: Description check

Explanation

The description follows the template structure and most required items are checked. Two gaps remain. First, the CHANGELOG.md entry is unchecked, yet the raw summary shows CHANGELOG.md was updated with three Unreleased 'Fixed' entries, so the item should be checked and the description should acknowledge that. Second, the description does not cover the bulk of the change: the 'Changed' list omits the PDF compression defaults (subsetFonts now false, useZopfliDeflate now false), the new embedMissingStrict and Result.requireAllEmbedded public API, the PdfFontAuditor fail-on-unopenable-page change, the QpdfLib isSubsetFontsSupported change, and the removal of the jpdfium_qpdf_subset_fonts stub in the no-qpdf build. The 'Testing' item for new or updated tests is unchecked even though multiple test files were changed, and the 'Updated jpdfium.h and ABI notes' item is unchecked while the function removal in jpdfium_qpdf.cpp is an ABI-relevant change. The description also states that FFM declarations in QpdfLib.java expose native subsetting diagnostics, but the raw summary says only isSubsetFontsSupported changed, which does not match. The 'Closes #(issue number)' line is also missing.

Resolution

  1. Check the CHANGELOG.md item, or explain why the Unreleased entries do not apply. 2. Add a 'Changed' bullet for each public or behavior change: CompressOptions.Builder subsetFonts default now false; CompressPreset useZopfliDeflate now false; new PdfFontEmbedder.embedMissingStrict and Result.requireAllEmbedded; PdfFontAuditor.audit now throws JPDFiumException on pages that cannot be opened; QpdfLib.isSubsetFontsSupported now also requires font replacement; removal of the jpdfium_qpdf_subset_fonts stub in the no-qpdf build. 3. Correct or explain the QpdfLib.java bullet, since the summary shows only isSubsetFontsSupported changed. 4. Check 'Added or updated tests' and list the test files touched (PdfCompressorTest, PdfFontEmbedderRoundTripTest, PdfFontEmbedderTest, FontCoverageTest, FontNormalizerTest). 5. Either update native/bridge/include/jpdfium.h and the ABI notes for the removed jpdfium_qpdf_subset_fonts function, or explain why no update is needed. 6. Add the 'Closes #(issue number)' reference.
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.

Share

@balazs-szucs
balazs-szucs added this pull request to stack #268 November 11, 2026 22:31
Comment thread native/bridge/src/jpdfium_pdfx.cpp Resolved
Comment thread native/bridge/src/jpdfium_qpdf.cpp Resolved
@balazs-szucs
balazs-szucs removed this pull request from stack #268 November 11, 2026 22:55
@balazs-szucs
balazs-szucs added this pull request to stack #269 November 11, 2026 22:56
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from b63398c to 6bbe6a6 Compare November 11, 2026 23:16
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from 6bbe6a6 to a2583a8 Compare November 11, 2026 23:29
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from a2583a8 to a31dae0 Compare November 11, 2026 23:57
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from a31dae0 to d358e39 Compare November 12, 2026 00:14
Comment thread native/bridge/src/jpdfium_qpdf.cpp Resolved
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from d358e39 to 5609f2e Compare November 12, 2026 00:37
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from a6c812e to 367b8c8 Compare November 12, 2026 03:11
@balazs-szucs

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

@balazs-szucs I’ll run a full review of the PR.


Learnings used

Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Java 25 style

- Use descriptive domain names. Avoid vague utility classes, object-typed ownership tokens, and boolean option matrices.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Java 25 style

- Reuse repository formatting, naming, and visibility conventions. Do not recommend preview/incubator APIs or a higher Java requirement without explicit project agreement.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Comments and documentation

- Remove stale TODOs, placeholder branches, speculative fallbacks, and obsolete comments in changed code. Do not require unrelated cleanup.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Tests, profiling, and delivery

- Every defect fix needs a focused regression with an observable expected result. No `assertTrue(true)`, swallowed failures, or tests that silently pass when fixtures/tools/source roots are missing.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Tests, profiling, and delivery

- Fuzz operation sequences with a real state model and expected statuses, not only no-crash parsing. Bound inputs/work, preserve corpus, and instrument the relevant native code.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Comments and documentation

- Comments explain invariants, ownership, non-obvious constraints, or reasons. Remove line-by-line narration, repeated summaries, decorative banners, and change-history commentary.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Java 25 style

- Avoid boxing, stream pipelines, repeated string encoding, capturing callbacks, and temporary collections in demonstrated hot paths. Do not claim that source-level allocations survive JIT optimization without measurement.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Java 25 style

- Use imports rather than package-qualified type names in method bodies and signatures. Qualification is acceptable for genuine name collisions, generated code, and intentionally explicit disambiguation.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Java 25 style

- Remove unused imports, raw types, dead branches, redundant casts, unnecessary wrappers, and duplicated helpers.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Memory and performance

- Scratch must support alignment, nesting, exceptions, overflow, and no escaping views. Resetting a bump pointer does not invalidate old FFM segments.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Comments and documentation

- Keep ordinary inline comments to one or two concise sentences. Longer public contracts and subtle ABI/lifetime explanations are justified; do not shorten them until ambiguity remains.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## FFM and ABI

- Confined arenas must remain on their owner thread. An execution-backend change must account for caller-confined buffers; extracting an address is not a solution.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## FFM and ABI

- Validate pointer/length pairs and capacity before reinterpretation. Zero-length address views do not establish ownership or safe bounds.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## C++23 style and ownership

- Reject undefined behavior used as an optimization. Alias, alignment, lifetime, and CPU-feature assumptions must be true and tested.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Native integrations

- libvips lazy graphs must retain borrowed pixels/files through evaluation and references. Avoid unnecessary materialization and uncontrolled inner/outer thread multiplication.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## C++23 style and ownership

- Use `span`/`string_view` for bounded borrowing only when backing lifetime is established. Do not return dangling views or operation-workspace-backed results.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## C++23 style and ownership

- Explicitly finalize fallible writers and check the result. A nonthrowing destructor is fallback cleanup, not evidence of successful output.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## C++23 style and ownership

- Avoid blanket catch blocks compensating for raw-resource management, manual `new`/`delete` ownership, unnecessary `shared_ptr`, and type-erased inner-loop callbacks.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Native integrations

- Audit duplicate dependency copies, symbols, compiler/runtime compatibility, allocator boundaries, initialization, and shutdown. Objects from incompatible library copies must not cross boundaries.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## FFM and ABI

- Review native-image metadata and ABI probes when signatures change. Prefer reproducible generation to handwritten drift.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## C++23 style and ownership

- Keep destructors and C ABI cleanup nonthrowing. Exported boundaries translate exceptions; `noexcept` alone does not translate them.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Output, preservation, and security

- Redaction must remove content, not merely paint an overlay. Extraction checks are scoped evidence, not proof about every PDF representation.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-20T15:53:18.441Z
Learning: Source excerpt:
# JPDFium review standards

## Native integrations

- PDFium bitmap formats, row stride, alpha, and renderer behavior must be queried or explicitly guaranteed. Preserve public pixel semantics.
Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Tests, profiling, and delivery

- Validate semantic preservation through reopen, independent structural checks, and representative rendering/text properties. A successful open is insufficient.
Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7c556a0 and 367b8c8.

Files selected for processing: 15

  • CHANGELOG.md
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressOptions.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressPreset.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfCompressor.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontAuditor.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java
  • jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderRoundTripTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontCoverageTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java
  • native/bridge/src/jpdfium_advanced.cpp
  • native/bridge/src/jpdfium_pdfx.cpp
  • native/bridge/src/jpdfium_qpdf.cpp

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

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.

CodeRabbit configuration file

Files:

  • native/bridge/src/jpdfium_advanced.cpp
  • native/bridge/src/jpdfium_pdfx.cpp
  • native/bridge/src/jpdfium_qpdf.cpp
Enforce meaningful assertions, deterministic concurrency, failure-path cleanup, and explicit native/stub requirements.

CodeRabbit configuration file

Files:

  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderRoundTripTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontCoverageTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java
Apply the Java 25 and FFM rules from .github/CODERABBIT_REVIEW.md.

CodeRabbit configuration file

Files:

  • jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressOptions.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressPreset.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfCompressor.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontAuditor.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java
  • jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderRoundTripTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontCoverageTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java
Source excerpt: These rules apply to maintained source.

CodeRabbit inference engine (.github/CODERABBIT_REVIEW.md)

Files:

  • CHANGELOG.md
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressOptions.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/CompressPreset.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfCompressor.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontAuditor.java
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java
  • jpdfium/src/main/java/stirling/software/jpdfium/panama/QpdfLib.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfCompressorTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderRoundTripTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontCoverageTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java
  • native/bridge/src/jpdfium_advanced.cpp
  • native/bridge/src/jpdfium_pdfx.cpp
  • native/bridge/src/jpdfium_qpdf.cpp
Learnings: 3

Common learnings

Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Tests, profiling, and delivery

- Validate semantic preservation through reopen, independent structural checks, and representative rendering/text properties. A successful open is insufficient.
Learning: 2026-10-31T10:47:27.879Z

Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## Java 25 style

- Use imports rather than package-qualified type names in method bodies and signatures. Qualification is acceptable for genuine name collisions, generated code, and intentionally explicit disambiguation.

Applied to files:

  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java
Learning: 2026-10-31T10:47:27.879Z

Learnt from: CR
Repo: Stirling-Tools/JPDFium PR: 0
File: .github/CODERABBIT_REVIEW.md:0-0
Timestamp: 2026-10-31T10:47:27.879Z
Learning: Source excerpt:
# JPDFium review standards

## C++23 style and ownership

- Check conversions, integer arithmetic, sizes, alignment, finite floating-point inputs, and narrowing before allocation or pointer operations.

Applied to files:

  • native/bridge/src/jpdfium_qpdf.cpp
ast-grep (0.51.1)

jpdfium/src/test/java/stirling/software/jpdfium/fonts/FontNormalizerTest.java

[warning] 588-588: 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.

(random-iv)

GitHub Check: CodeQL

native/bridge/src/jpdfium_pdfx.cpp

[notice] 259-259: Equality test on floating-point values
Equality checks on floating point values can yield unexpected results.

native/bridge/src/jpdfium_qpdf.cpp

[notice] 237-237: Equality test on floating-point values
Equality checks on floating point values can yield unexpected results.


[warning] 2220-2220: Poorly documented large function
Poorly documented function: fewer than 2% comments for a function of 110 lines.

Comment thread native/bridge/src/jpdfium_advanced.cpp Resolved
Comment thread native/bridge/src/jpdfium_pdfx.cpp Resolved
Comment thread native/bridge/src/jpdfium_qpdf.cpp Resolved
Comment thread native/bridge/src/jpdfium_qpdf.cpp Resolved
Comment thread native/bridge/src/jpdfium_qpdf.cpp Resolved
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch 2 times, most recently from dde5718 to a216d22 Compare November 15, 2026 11:55
@balazs-szucs
balazs-szucs removed this pull request from stack #269 November 15, 2026 11:57
@balazs-szucs balazs-szucs changed the title Repair CIDSet and widths and fail closed on unresolved fonts Repair CIDSet, widths, and CFF/PDF/X font handling in native bridge Nov 15, 2026
@balazs-szucs
balazs-szucs added this pull request to stack #298 November 15, 2026 12:00
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from a216d22 to af66460 Compare November 15, 2026 16:50
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from af66460 to 410f1e5 Compare November 18, 2026 19:54
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from 410f1e5 to 6054a2e Compare November 18, 2026 20:32
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
@balazs-szucs
balazs-szucs force-pushed the refactor/font-15-compress-repair branch from 6054a2e to a965a25 Compare November 19, 2026 12:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants