Skip to content
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub
React Native Guides Optimization

Document Optimization ​

Document optimization reduces PDF file size for storage and transfer. Starting with 3.2.0, ComPDF React Native SDK supports reading optimization settings, adjusting image quality and resolution, cleaning document resources, and saving a copy.

Results depend on the original document, image quality, and enabled cleanup options. Some options remove bookmarks, annotations, forms, or scripts. Select options for your workflow and inspect the output content.

Workflow ​

  1. Save pending edits, then read and adjust optimization settings.
  2. Call optimizeSaveAsCopy() to output a copy and optionally receive page progress.
  3. Check success, cancellation, and statistics, then open the output for review.

Guides ​

Document Compression and Optimization

Configure image and resource optimization, cancel a task, and handle output and reader restoration results.