0

I have an excel file stored in database.I am trying to export this file into pdf by using Aspose.Cell.

The pdf file which has been generated is not showing all the fields that exists in excel file.

byte[] data = GetInvoiceImageStream(invoiceId);
var fileName = codaOfficeCode.Trim() + "_" + 
               EfinanceStaticData.ManageAttachmentInvoiceCode + "_" + 
               invoiceNumber.Trim();

MemoryStream ms = new MemoryStream();
ms.Write(data, 0, data.Length);
ms.Position = 0;
Workbook workbook = new Workbook(ms);

workbook.Save("C:/xyz.pdf", SaveFormat.Pdf);
Vishwajeet
  • 1,575
  • 2
  • 19
  • 35

1 Answers1

1

Please try these things.

Call workbook.CalculateFormula() before saving to pdf.

You can also create one page for entire worksheet. Please use PdfSaveOptions.OnePagePerSheet option and set it true.

PdfSaveOptions opts = new PdfSaveOptions();
opts.OnePagePerSheet = true;

workbook.Save("C:/xyz.pdf", opts);

If these things do not work, then please give a try to latest Aspose.Cells version and also post your issue in Aspose.Cells forum.

Aspose.Cells Forum Link:

http://www.aspose.com/community/forums/aspose.cells-product-family/19/showforum.aspx

Note: I am working as Developer Evangelist at Aspose

shakeel
  • 1,717
  • 10
  • 14