Skip to content
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,3 @@
<Solution>
<Project Path="EnableFormFields/EnableFormFields.csproj" />
</Solution>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<None Remove="Output\.gitkeep" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Output\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.XlsIORenderer.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Data\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EnableFormFields.Output
{
class _
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.IO;
using Syncfusion.XlsIO;
using Syncfusion.XlsIORenderer;
using Syncfusion.Pdf;

namespace EnableFormFields
{
class Program
{
static void Main(string[] args)
{
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();

//Disable ExportBookmarks
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/FormFieldsInPDF.pdf"));
#endregion
}
}
}
}
Loading