-
Notifications
You must be signed in to change notification settings - Fork 566
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
Can you provide a method to adjust the size of the pdf to A4 size, and also include the adaptation of AcroForms? #1101
Comments
Can one assume that the content of the pages already fits on A4 and one merely has to increase or decrease the margins? Then it suffices to change media and crop boxes. |
It should be necessary to scale. Such as this pdf: |
You want to read an existing PDF and than recreate it with a "better" PageSize? |
I think, if you want to scale and reflow the content, you can use OpenPDF to do this. But this functionality is quite high level to implement directly in the library. I don't even know how one could do this. The text must be extracted, and den inserted in the new document. And images too. A very complex task. |
I tried itext,It can move the content of the page, but AcroForms are lost,How to transfer AcroForms as is,Like the 6.pdf this file, how complete scale: PdfReader pdfReader = new PdfReader(source); |
Copying the page with Scaling (obviously) changes the coordinates of the content. Thus, all other objects that also contain coordinates on the page, need to be adjusted. This includes the annotations but also objects like link destinations. |
Is there any code example of specific implementation? thanks. |
I fear there is no such an example. This is a very specific problem, and scaling thinks around is not trivial. Such an example "could" be in |
Because the page width of some PDFs is very large, I want to adjust the PDF to an A4 size that is easier to read. I hope there is a way to do this easily.
Here is a pdf sample with AcroForms:
6.pdf
The text was updated successfully, but these errors were encountered: