import com.aspose.pdf.*; public class Main { public static void main(String[] args) throws Exception {//Fill PDF Form // Load a license License lic = new License(); lic.setLicense("Conholdate.Total.Product.Family.lic"); // Load the PDF Document pdf = new Document("TextBox_out.pdf"); // Access the textbox TextBoxField textbox = (TextBoxField) pdf.getForm().get("textbox1"); // Set the value textbox.setValue("New value for the field"); // Set the field appearance textbox.setColor(Color.fromRgb(Color.getRed().toRgb())); textbox.setTextVerticalAlignment(VerticalAlignment.Bottom); // Save the PDF pdf.save("Filled.pdf"); System.out.println("Done"); } }