Skip to content

Commit 7f7bf4f

Browse files
authored
Merge pull request #343 from SyncfusionExamples/EnableFormFields
UG documentation 1043309: Need to add the UG documentation and KB for Enable form fields in excel to pdf converter settings
2 parents 6e3428e + b013c22 commit 7f7bf4f

5 files changed

Lines changed: 82 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="EnableFormFields/EnableFormFields.csproj" />
3+
</Solution>
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<None Remove="Output\.gitkeep" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<EmbeddedResource Include="Output\*">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</EmbeddedResource>
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<PackageReference Include="Syncfusion.XlsIORenderer.Net.Core" Version="*" />
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<EmbeddedResource Include="Data\*">
26+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
27+
</EmbeddedResource>
28+
</ItemGroup>
29+
30+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EnableFormFields.Output
8+
{
9+
class _
10+
{
11+
}
12+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.IO;
2+
using Syncfusion.XlsIO;
3+
using Syncfusion.XlsIORenderer;
4+
using Syncfusion.Pdf;
5+
6+
namespace EnableFormFields
7+
{
8+
class Program
9+
{
10+
static void Main(string[] args)
11+
{
12+
using (ExcelEngine excelEngine = new ExcelEngine())
13+
{
14+
IApplication application = excelEngine.Excel;
15+
application.DefaultVersion = ExcelVersion.Xlsx;
16+
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));
17+
18+
//Initialize XlsIORendererSettings
19+
XlsIORendererSettings settings = new XlsIORendererSettings();
20+
21+
//Disable ExportBookmarks
22+
settings.EnableFormFields = true;
23+
24+
//Initialize XlsIORenderer
25+
XlsIORenderer renderer = new XlsIORenderer();
26+
27+
//Convert the Excel document to PDF with renderer settings
28+
PdfDocument pdfDocument = renderer.ConvertToPDF(workbook, settings);
29+
30+
#region Save
31+
//Saving the workbook
32+
pdfDocument.Save(Path.GetFullPath("Output/FormFieldsInPDF.pdf"));
33+
#endregion
34+
}
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)