Relative Content

Tag Archive for javapdfbox

How to apply the wordSpacing to the PDF

I need to apply the wordSpacing (Tw) to the PDF, but it doesn’t work because the PDFBox library encodes the text and the U+0020 symbol does not appear in the PDF.
How can we avoid this behavior and apply the wordSpacing parameter via PDFBox library?

PDFBox how to insert a page from a donor document and then close the donor

I have a document processing pipeline in which I need to add pages to from a donor document. All examples I have found to clone the donor page do not continue to work after the donor document has been closed. I need to open a donor, pull a page from it, insert it into the document in the pipeline, and then close the donor (or it closes itself when it goes out of scope). I am using PDFBox 2.0.27

Saving a PDF-document with PDFBox results in hanging endlessly

I use PDFBox in a large organization, and usually it works great. But I’ve been encountering sporadic problems with PDFBox hanging when saving a PDF-document. It uses up all the available memory. Upon inspection it looks like this stack trace is related:

PdfBox – Determine the position of the last line of a page

I need to transfer the creation of a PDF from the React frontend (jsPdf) to a Java backend. I would like to approach the implementation similar to the frontend with static methods for the respective chapters, headings, images, etc.. For this approach, I need the position of the last line of the previous content of the current page before inserting the new content.

Convert a PDF file to image with best quality

I am converting a PDF to an image using PDFBox. The best resolution I can currently achieve in the output image is 72 pixels per inch (PPI) irrespective of the DPI value in the conversion. However, I need a higher resolution. Can you please provide suggestions on how to achieve a better resolution?