-
Notifications
You must be signed in to change notification settings - Fork 35
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
B 22288 fix pdfcpu int #14723
B 22288 fix pdfcpu int #14723
Conversation
did you make the changes in the transcom/pdfcpu or just suggesting the pdfcpu team to make the changes? |
I made the changes in transcom/pdfcpu and will be suggesting them to the pdfcpu team |
the description mentioned the pdfpcr repo - is why I asked |
Ah, whoops let me fix that |
Got a test to fix |
f4e591d
@deandreJones @danieljordan-caci see PR description "Test changes" for what changed since your last review |
B-22288
Summary
The pdfcpu config wasn't being passed to bookmarks, pdfcpu had hard-coded optimization, pdfcpu had another hidden config.yml file that can be fed into the app which I adjusted the defaults to set optimization to false. These have all been remedied, and now bookmarking will not be optimized (Which breaks things). The previous PR fixed the merging portion, this one fixes bookmarks, now all is dandy.
Pointed fork to the fixes.
Warning
Where are the pdfcpu code changes? Right here
https://github.com/transcom/pdfcpu/compare/83d2d75ad4cd..4b416bd62126
Setup to Run the Code
Important
You might have cached pdfcpu configs that could cause an issue during testing. You should only have to do this if you get testing issues.
Here are the two spots to delete it from:
rm "/Users/${USER}/Library/Application Support/pdfcpu/config.yml
pkg/paperwork/generator.go:121
to see the variable. Once you find it,rm ${tmp_dir}/pdfcpu/config.yml
How to test
sample.pdf
Testing Document.pdf
outlines-with-loop.pdf
Pdfcpu
Opened an issue with the pdfcpu maintainers pdfcpu/pdfcpu#1089
Test changes
Image extraction from PDF requires optimization to be enabled. I have verified the PDFs are still embedding properly by writing the file locally and previewing it (snippet below), as well as adjusting the test to check page count as an interim solution. The extract image from PDF is a func only used in our tests to validate file creation. This interim solution is a workaround until the pdfcpu optimization overflow error has been resolved.