我正在使用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();
Run Code Online (Sandbox Code Playgroud)
我的输出:
