0

I am using syncfusion way to create excel sheets. Now I want to create pdf with same format. I looked at sample code of syncfusion and its very complex. So Is there any way to use already created excels to generate pdfs.

I used this code to create excel

Assembly executingAssembly = typeof(MainPage).GetTypeInfo().Assembly;
            Stream inputStream = executingAssembly.GetManifestResourceStream("CRICKIT.Assets.TVM.xlsx");

            IWorkbook book = await this.excelEngine.Excel.Workbooks.OpenAsync(inputStream);
            inputStream.Dispose();

            //Create Template Marker Processor
            ITemplateMarkersProcessor marker = book.CreateTemplateMarkersProcessor();
            //Binding the business object with the marker.
            marker.AddVariable("TVMManager", App.ViewModel.TVMManager);

            //Applies the marker.
            marker.ApplyMarkers(UnknownVariableAction.Skip);
            return book;
4

2 回答 2

3

如果您有 Essential Studio 的 PDF 部分,SyncFusion 本身提供了一种将 Excel 电子表格转换为 PDF 的方法。

如何进行转换的示例如下:

http://asp.syncfusion.com/Windows/demos/reporting/pdf/Import%20to%20PDF/Excel%20to%20PDF/Sample.aspx

在最简单的形式中,它看起来像这样:

//Open the Excel document to convert
ExcelToPdfConverter converter=new ExcelToPdfConverter("Sample.xlsx");
//Convert Excel document into PDF document
PdfDocument pdfDoc = converter.Convert();
pdfDoc.Save("ExceltoPDF.pdf");

希望这可以帮助。

于 2013-07-18T08:41:57.430 回答
-1

目前,在 Syncfusion Essential XlsIO WINRT 控件中不支持将 excel 工作表转换为 PDF 文档。

谢谢, Sridhar.S

于 2013-06-27T06:47:11.780 回答