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
api: Add support for page boundaries #216
Comments
Hi there! I am aware proper support for PDF's page boundaries is lacking. Thanks for using pdfcpu 💚 |
It will be nice if the cli tool also has the ability to manage all the boxes, not only the > pdfcpu boxe -pages '!2-4,!12-' media,trim="0 0 300 450" crop="50 50 250 400" would be nice. Other possible commands for |
For now the plan is to extend the I am hesitant to provide a separate cli command for juggling around with page boundaries for a given PDF because the consequences can be brutal and irreversible. Basically this is smth for the api but necessarily for the cli. Can you describe your specific usecase for this cli feature? |
If for example you have a software that requires |
Please be specific? |
I'm not pdf-boxes specialist neither ;) As far as I know all "standard" applications (viewers, home printers) use only the You can check some info about the pdf boxes here. |
This is fixed with the latest commit including the two new commands:
|
Recently I had to define a TrimBox and a BleedBox for PDFs going to a print shop. I did this by essentially copying the
ImportImages
func to be able to access the dict of the newly created image page.I guess another way to accomplish this is by running
ReadContext
afterwards to access the context, but it's still a bit clunky to me.I think a better way would be to allow a callback func in the Import config that passes references to the page dict allowing you to insert/modify these boundary boxes. This way you don't have to change the method signature and thus won't break any compatibility with previous versions.
Something like this:
I guess something like this could also solve #210 by enabling insertion of a CropBox
I would be happy to submit a PR for this, although I haven't considered the CLI part of the project with this feature proposal.
The text was updated successfully, but these errors were encountered: