feat(pdf): implement advanced PDF operations (v0.0.4)#2
Merged
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
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!