Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2318,3 +2318,86 @@ End Using
{% endtabs%}

A complete working example demonstrating how to enable the <a href="https://help.syncfusion.com/cr/document-processing/Syncfusion.ExcelToPdfConverter.ExcelToPdfConverterSettings.html#Syncfusion_ExcelToPdfConverter_ExcelToPdfConverterSettings_ShowFileNameWithExtension">ShowFileNameWithExtension</a> property during Excel to PDF conversion in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Excel%20to%20PDF/Show%20file%20name%20with%20extension%20in%20PDF/.NET/ShowFileNameWithExtension">this GitHub page</a>.

## Enable Form Fields

This property enables the form fields in the Excel worksheet to be rendered as interactive form fields in the PDF document. The default value is FALSE.

The following code snippet explains how to enable the [EnableFormFields](https://help.syncfusion.com/cr/document-processing/Syncfusion.ExcelToPdfConverter.ExcelToPdfConverterSettings.html#Syncfusion_ExcelToPdfConverter_ExcelToPdfConverterSettings_EnableFormFields) property while converting an Excel document to PDF.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));

//Initialize XlsIORendererSettings
XlsIORendererSettings settings = new XlsIORendererSettings();

//Enable Form Fields
settings.EnableFormFields = true;

//Initialize XlsIORenderer
XlsIORenderer renderer = new XlsIORenderer();

//Convert the Excel document to PDF with renderer settings
PdfDocument pdfDocument = renderer.ConvertToPDF(workbook, settings);

#region Save
//Saving the workbook
pdfDocument.Save(Path.GetFullPath("Output/BookmarksInPDF.pdf"));
#endregion
}
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");

//Initialize ExcelToPdfConverterSettings
ExcelToPdfConverterSettings settings = new ExcelToPdfConverterSettings();

//Enable Form Fields
settings.EnableFormFields = true;

//Load the Excel document into ExcelToPdfConverter
ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);

//Convert the Excel document to PDF with converter settings
PdfDocument document = converter.Convert(settings);

//Save the PDF document
document.Save("Output.pdf");
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
Using excelEngine As ExcelEngine = New ExcelEngine()
Dim application As IApplication = excelEngine.Excel
application.DefaultVersion = ExcelVersion.Xlsx
Dim workbook As IWorkbook = application.Workbooks.Open("Sample.xlsx")

'Initialize ExcelToPdfConverterSettings
Dim settings As ExcelToPdfConverterSettings = New ExcelToPdfConverterSettings()

'Enable Form Fields
settings.EnableFormFields = True

'Load the Excel document into ExcelToPdfConverter
Dim converter As ExcelToPdfConverter = New ExcelToPdfConverter(workbook)

'Convert the Excel document to PDF with converter settings
Dim document As PdfDocument = converter.Convert(settings)

'Save the PDF document
document.Save("Output.pdf")
End Using
{% endhighlight %}
{% endtabs %}

A complete working sample to enable form fields in Excel to PDF conversion in C# is present on [this GitHub page](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/EnableFormFields/Excel%20to%20PDF/EnableFormFields/.NET/EnableFormFields).