在winrt中使用syncfusion创buildexcel的createPdf

我正在使用syncfusion的方式来创buildExcel表。 现在我想创build相同格式的PDF。 我看了一下syncfusion的示例代码,它非常复杂。 那么有什么办法可以使用已经创build的Excel来生成PDF文件。

我用这个代码来创buildexcel

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; 

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

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

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

最简单的forms如下所示:

 //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"); 

希望这可以帮助。

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

谢谢,Sridhar.S