Hi,
I am trying to create a simple editable pdf form using aspose-pdf-java. Below is the code snippet i am using. But I am not getting my expected outcome.
Document pdfDoc = new Document();
Page page = pdfDoc.getPages().add().
page.getParagraphs().add(new TextFragment(“First Name:”);
TextBoxField textBoxField = new TextBoxField(pdfDocument.getPages().get_Item(1), new Rectangle(100, 200, 300, 300);
textBoxField .setPartialName(“Partial Name);
textBoxField.setValue(”);
pdfDoc .getForm().add(textBoxField, 1);
page.getParagraphs().add(new TextFragment(“Last Name:”));
TextBoxField textBoxField1= new TextBoxField(pdfDocument.getPages().get_Item(1), new Rectangle(100, 200, 300, 300);
textBoxField1.setPartialName(“Partial Name);
textBoxField1.setValue(”);
pdfDoc .getForm().add(textBoxField1, 1);
pdfDoc.save(“simple_form.pdf”);
My Expected Output:
First Name:
--------(Editable field)--------------------------------
Last Name:
--------(Editable Field)-------------------------------
Note: I am using only evaluation version only.
Appreciate your earlier response.