diff --git a/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension.slnx b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension.slnx new file mode 100644 index 00000000..3475a949 --- /dev/null +++ b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Data/InputTemplate.xlsx b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Data/InputTemplate.xlsx new file mode 100644 index 00000000..39e77f58 Binary files /dev/null and b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Data/InputTemplate.xlsx differ diff --git a/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Output/.gitkeep b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Program.cs b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Program.cs new file mode 100644 index 00000000..865fdbf7 --- /dev/null +++ b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/Program.cs @@ -0,0 +1,36 @@ +using Syncfusion.XlsIO; +using Syncfusion.Pdf; +using Syncfusion.XlsIORenderer; + +namespace ShowFileNameWithExtension +{ + 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(); + + //Enable ShowFileNameWithExtension property + settings.ShowFileNameWithExtension = 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/Output.pdf")); + #endregion + } + } + } +} \ No newline at end of file diff --git a/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/ShowFileNameWithExtension.csproj b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/ShowFileNameWithExtension.csproj new file mode 100644 index 00000000..a7a7413c --- /dev/null +++ b/Excel to PDF/Show file name with extension in PDF/.NET/ShowFileNameWithExtension/ShowFileNameWithExtension/ShowFileNameWithExtension.csproj @@ -0,0 +1,23 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + Always + + + Always + + + +