How can I insert text (1 line max) at the beginning of the first page of a pdf document and move the rest of the page content down (to the next pages if necessary) or reformat the page content to fit on one page using the PDFBox library?
Asked
Active
Viewed 35 times
1
-
*Moving the rest of the page content down,* in particular *to the next pages if necessary,* can be quite a hassle as this is contrary to what PDF is designed for. Whether or not *reformatting the page content to fit on one page* is an option, depends on which kinds of *reformatting* operations are allowed. E.g. can the whole existing page content simply be scaled down to 90% its original size to make place for the addition on top? Or, even better, is it ok to enlarge the page dimension by the space required for your extra line of text? – mkl May 03 '21 at 16:49
-
@mkl Thanks for your suggestion, how can I scale down page content? Or can I just add a header to the first page? – Lenka May 04 '21 at 18:47
-
2https://stackoverflow.com/questions/49672166/ – Tilman Hausherr May 05 '21 at 06:35