Conversation
c8e9221 to
9b720ff
Compare
…t coverage ## Performance Improvements - Optimized object caching and resolution - Improved xref stream parsing efficiency - Added benchmark tests for performance tracking ## Security Hardening - Added panic recovery to Page.Content() for malformed content streams - Tested against 2,700+ PDFs from PDF Association corpora with no crashes - Malicious/malformed inputs return errors instead of panicking ## Test Coverage (50% → 77%) - Added comprehensive unit tests for all core modules - Added corpus security test with on-demand download from: - veraPDF corpus (2,694 files) - BFO PDF/A test suite (24 files) - PDF Cabinet of Horrors (24 files) ## CI/CD - Added GitHub Actions workflow with test, corpus-test, and build jobs - Cross-platform builds (linux/darwin/windows × amd64/arm64) ## API Changes - Extracted types.go for cleaner Value/Object API - Added GetObject() method for direct object access - Added Xref() method to expose cross-reference table
9b720ff to
11f414e
Compare
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.
This pull request introduces comprehensive improvements to the PDF library, focusing on modernizing the codebase, enhancing security and performance, and improving testing and CI practices. Key changes include a major update to the documentation, the addition of advanced benchmark and security corpus tests, and the introduction of a GitHub Actions CI workflow. Several new test files have been added to ensure correctness and robustness of encryption and filter logic.
Documentation and Project Metadata Updates:
README.mdto document the library's new high-performance, zero-allocation AST, improved security features (AES-128/256 support), robust error handling, memory efficiency, and benchmark results.go.modto define the module path asgithub.com/digitorus/pdfand set Go version to 1.23.Continuous Integration and Testing:
.github/workflows/ci.yml) to automate testing, security corpus validation, and cross-platform builds for multiple OS/architectures.Benchmarking and Security Testing:
benchmark_test.goto provide benchmarks for object resolution and full object parsing, enabling performance regression tracking.corpus_test.goto enable large-scale security and robustness testing using PDF Association corpora, with support for automatic corpus downloading and panic recovery to ensure no malformed input can crash the library.Unit Testing for Core Features:
encryption_test.gowith comprehensive tests for cryptographic key derivation, RC4/AES decryption, PDF 2.0 authentication, and stream decryption logic.filter_test.goto verify the correctness of core PDF stream filters (ASCIIHexDecode, ASCII85Decode, FlateDecode).