Skip to content

Add PDF export support for PAG files#3343

Open
OnionsYu wants to merge 27 commits intoTencent:mainfrom
OnionsYu:feature/onionsyu_export_pdf
Open

Add PDF export support for PAG files#3343
OnionsYu wants to merge 27 commits intoTencent:mainfrom
OnionsYu:feature/onionsyu_export_pdf

Conversation

@OnionsYu
Copy link
Copy Markdown
Contributor

This PR adds a full-featured PDF exporter for PAG files, including:

  • New PDFExporter implementation supporting layers, groups, transforms, blend modes, gradients, patterns, images, soft masks, and text glyphs
  • CID font embedding with UTF-16BE encoding for non-ASCII text rendering
  • Shared ExporterUtils extracted from SVG and PDF exporters to reduce code duplication
  • New cmake option PAG_BUILD_PDF to control PDF export feature inclusion
  • New test cases covering PDF export functionality

The exporter converts PAG content to PDF format by traversing the layer tree and generating corresponding PDF drawing operations.

OnionsYu added 19 commits March 24, 2026 16:47
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 95.63319% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.16%. Comparing base (7395eb2) to head (7c6a302).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/pagx/pdf/PDFExporter.cpp 89.07% 59 Missing and 45 partials ⚠️
src/pagx/utils/ExporterUtils.cpp 94.28% 5 Missing and 5 partials ⚠️
test/src/PAGXPDFTest.cpp 99.12% 3 Missing and 6 partials ⚠️
src/cli/CommandConvert.cpp 90.24% 2 Missing and 2 partials ⚠️
test/src/PAGXSVGTest.cpp 99.47% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3343      +/-   ##
==========================================
+ Coverage   75.21%   77.16%   +1.94%     
==========================================
  Files         509      513       +4     
  Lines       35211    38062    +2851     
  Branches    11270    11709     +439     
==========================================
+ Hits        26485    29369    +2884     
+ Misses       6422     6331      -91     
- Partials     2304     2362      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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