I am trying to create a PDF file with a lot of text boxes in the document and textfields from another class. I am using PDFBox.
OK, creating a new file is easy and w
This implementation is deprecated.
PDPageContentStream title1 = new PDPageContentStream(doc, page, true, true);
The new implementation would be
PDPageContentStream title1 = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.OVERWRITE, true);
PDPageContentStream title1 = new PDPageContentStream(doc, page, true, true);
OP posted this as the answer, so this will flag to the system that there was an answer
Furthermore, if the first content stream contains operations substantially changing the graphics state, e.g. by changing the current transformation matrix, and one wants the new content stream to start with these changes reverted, one should use the constructor with three boolean parameters:
PDPageContentStream title1 = new PDPageContentStream(doc, page, true, true, true);