Learn how to add a text box in a PDF so that you can add more descriptions, explanations, or dialogue to your document. Whether you forgot to include a piece of information or just want to include a little clarification, adding a text box to a PDF is an easy way to update your ...
我们首先需要创建一个PDF文档对象,并添加页面: PDDocumentdocument=newPDDocument();PDPagepage=newPDPage();document.addPage(page); 1. 2. 3. 第三步:创建文本域 接下来,我们需要创建一个文本域对象,并设置其属性,例如位置,大小,字体等: PDAcroFormacroForm=newPDAcroForm(document);PDTextFieldtextBox=newPDText...
You must click this button to add a text box to the PDF document.Step 4: Create the desired type of text box and add your textWith Adobe Acrobat, you can add text box to your PDF document simply by clicking on the area where you want to add it. Right-click and go to properties ...
PdfTextBoxField textBox = new PdfTextBoxField(page, "TextBox");//创建文本框对象 textBox.setBounds(tbxBounds);//设置文本框的Bounds textBox.setText("刘兴");//填充文本框 textBox.setFont(font);//应用文本框的字体 doc.getForm().getFields().add(textBox);//添加文本框到PDF域的集合 baseY +...
Align text to the left, right or centre Add more text to your document You can add as much text as you like to your PDF pages. To add new text, simply click off the current text box you are writing in and select the text icon again from the toolbar. To save time customizing, eac...
Using Acrobat online services allows you to add a text box to a PDF from anywhere. Follow these steps to type on a PDF on iPhone. Open Safari or any other web browser and navigate to Edit PDF in Acrobat online. Select Edit PDF. Choose a PDF to edit by clicking “Select a file.” ...
//创建Rectangle2D对象PdfTextBoxField textBox =newPdfTextBoxField(page, "TextBox");//创建文本框对象textBox.setBounds(tbxBounds);//设置文本框的BoundstextBox.setText("刘兴");//填充文本框textBox.setFont(font);//应用文本框的字体doc.getForm().getFields().add(textBox);//添加文本框到PDF域的...
// 添加文本水印 PdfWatermark watermark = new PdfWatermark("Watermark"); watermark.setFont(new PdfFont(PdfFontFamily.Helvetica, 36)); watermark.setOpacity(0.5f); page.getWatermarks().add(watermark);} 最后,需要保存修改后的 PDF 文件: pdf.saveToFile("output.pdf");pdf.close(); ...
You can also click on ‘Add text’ in the right click menu anywhere on the document to add a text box. Try it to out type in text and take notes on top and in the margins of the PDF documents you are reading!\n\n\n Once you have placed the text box, you can change the font...
PDPagepage=newPDPage();document.addPage(page); 1. 2. 步骤4:设置页面的大小和边距 在PDF文档中,我们可以设置页面的大小和边距。可以使用PDRectangle类来设置页面的大小。以下是设置页面大小和边距的代码: PDRectanglepageSize=PDRectangle.A4;page.setMediaBox(pageSize);page.setCropBox(pageSize); ...