我正在使用Pdfbox使用Java生成PDF文件。问题是,当我在文档中添加长文本内容时,它无法正确显示。仅显示其中的一部分。在一行中也是如此。
我希望文本多行显示。
我的代码如下:
PDPageContentStream pdfContent=new PDPageContentStream(pdfDocument, pdfPage, true, true);
pdfContent.beginText();
pdfContent.setFont(pdfFont, 11);
pdfContent.moveTextPositionByAmount(30,750);
pdfContent.drawString("I am trying to create a PDF file with a lot of text contents in the document. I am using PDFBox");
pdfContent.endText();
我的输出:
相关分类