-
Notifications
You must be signed in to change notification settings - Fork 0
feat(pdf): implement advanced PDF operations (v0.0.4) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tion, reordering, and extraction
…nearization, reordering, and extraction
…ardcoded settings
…ion detection and probing
…ization, reordering, and extraction options
…nstallation instructions for multiple platforms
… usability, including enhanced help descriptions and removal of deprecated flags
…larity, replacing pdfcpu with Ghostscript
… Ghostscript across multiple platforms
…ists for multiple platforms
…extraction and improve command generation for various formats
…ew output formats (png, jpeg) for PDF extraction
…om YAML configuration
…for dynamic configuration
…add `serde_yaml`
…alidate preset properties
…PresetDefinition` deserialization and cloning
…xistent PDF files
…for extreme compression
…tions, and replace `pdfcpu` with `ghostscript` as the primary tool for PDF operations
…oss multiple OS environments
…utions and improve clarity
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. Comment |
…v::temp_dir` for better clarity and cleanup
Description
Implements all v0.0.4 deliverables for PDF Advanced Operations, including new commands for compression, linearization, page reordering, and page extraction. Adds
Ghostscriptas the primary tool for PDF compression (replacingpdfcpu), and introduces a YAML-based preset system for compression configuration.New Commands
pdf compress- Compress PDFs with 4 preset levels (light, standard, high, xhigh)pdf linearize- Optimize PDFs for fast web viewingpdf reorder- Reorder pages in a PDFpdf extract- Extract pages to PDF, PNG, or JPEG formatsCompression Results (14MB test file)
Type of Change
feat: New featureScope
cli- CLI commands and interfacecore- Core library functionalitytools- Tool integrations (qpdf, ghostscript, etc.)pdf- PDF-specific operationspackaging- Package configurationsRelated Issues
None
Checklist
type(scope): descriptioncargo test)cargo clippyandcargo fmt)Breaking Changes
Migration Guide
ghostscriptinstead ofpdfcpufor PDF compression. Update your dependencies:brew install ghostscriptsudo apt install ghostscriptchoco install ghostscriptSummary of Changes
Features
xhighcompression preset for sub-1MB outputqpdf --show-npagesintegration for accurate page countsInfrastructure
Tests
Screenshots / Output
$ forgekit pdf compress input.pdf -o output.pdf -l xhigh
Successfully compressed PDF to output.pdf
$ forgekit pdf extract input.pdf -d ./images -p 1-3 --format png
Successfully extracted images to directory ./images
$ forgekit check-deps
✓ qpdf: found at /opt/homebrew/bin/qpdf
✓ gs: found at /opt/homebrew/bin/gs
✓ All dependencies are installed!