I have a problem with xls to PDF conversion.
This is the code that I've used to generate PDF file:
- Code: Select all
// Set PDF template
PdfConverter pdfConverter = new PdfConverter(workbook);//where workbook corresponds to my XLS file
PdfDocument pdfDocument = new PdfDocument();
pdfDocument.PageSettings.Orientation = PdfPageOrientation.Landscape;
//Convert Excel to PDF using the template above
PdfConverterSettings settings = new PdfConverterSettings();
settings.FitSheetToOnePage = FitToPageType.ScaleWidthDifferentFactor;
settings.ExportDocumentProperties = true;
settings.EmbedFonts = true;
settings.TemplateDocument = pdfDocument;
settings.ExportBookmarks = true;
pdfDocument = pdfConverter.Convert(settings);
// Save PDF to stream
System.IO.MemoryStream stream = new System.IO.MemoryStream();
pdfDocument.SaveToStream(stream);
If in the XLS file I have a cell that contains a formula (eg "=SUM(A1+A2)"), in the corresponding cell of the PDF file, the value is equal to 0.
Why?!