We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Create a fillable PDF from a MS Word file

Hi and thanks for a great product!

Is it possible using aspose to create a fillable pdf-form from an existing MS Word file that contains form-fields?

BR Lars

@lars.olsson Sure, you should simply enable PdfSaveOptions.PreserveFormFields option. For example see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Isert different types of form fields
builder.Write("CheckBox form field: ");
builder.InsertCheckBox("check1", false, 12);
builder.Writeln();

builder.Write("TextInput form field: ");
builder.InsertTextInput("text1", TextFormFieldType.Regular, "", "some default text", 0);
builder.Writeln();

builder.Write("ComboBox form field: ");
builder.InsertComboBox("combo1", new string[] { "item1", "item2", "item3" }, 0);

PdfSaveOptions opt = new PdfSaveOptions();
opt.PreserveFormFields = true;

doc.Save(@"C:\Temp\out.pdf", opt);
1 Like

Thanks! I will test this!

1 Like