Free Support Forum - aspose.com

Merging PDF files (that orginated from Excel files) causing cells in PDF to get updated with random values on SaveAs

I am experiencing a strange issue when I convert certain spreadsheets to PDF, merge them into a single PDF and then do a Save As in any PDF authoring software such as Acrobat Pro. What is happening is that the cell values from page 20 (the start of the second spreadsheet) and on are getting updated with random values.

The test files are attached and here is my scenario:

1. I convert the attached spreadsheets to PDF using Aspose.Cells.

2, I then merged the 3 PDFs into a single PDF using Aspose.Pdf.Kit.

3. I can open the merged_orig.pdf file and the information displays correctly in Reader but if I open the merged_orig.pdf in Acrobat Professional and perform a Save As, the cells starting from page 20 and on get updated to random values (see merged_saveas.pdf).

I tried another test by merging the 3 PDF files after I converted them to PDF using Office 2007 (instead of Aspose.Cells) and I didnt have the problem, everything displayed correctly even when doing a SaveAs. I dont beleieve there are any formulas, etc. in any of the 3 spreadsheets, just values in cells.

Please help as this is a production system that has been using Aspose for over a year now and our customers are insurance companies requesting these PDFs.

Hi Jon,

Please share the code snippet you’re using at your end, so we could test the issue using your particular scenario. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

Here you go...just Aspose 101:

static void MyTest(string baseDir)

{

string convertDir = Path.Combine(baseDir, "converted");

if (!Directory.Exists(convertDir))

Directory.CreateDirectory(convertDir);

string[] outFiles = new string[System.IO.Directory.GetFiles(baseDir).Length];

int cnt = 0;

foreach (string inFile in System.IO.Directory.GetFiles(baseDir))

{

FileInfo origFile = new FileInfo(inFile);

string outFile = Path.Combine(convertDir, origFile.Name.Replace(origFile.Extension, ".pdf"));

outFiles[cnt++] = outFile;

Workbook workbook = new Aspose.Cells.Workbook(inFile);

workbook.Save(outFile, Aspose.Cells.SaveFormat.Pdf);

}

PdfFileEditor pdfEditor = new PdfFileEditor();

string mergeFile = Path.Combine(convertDir, "merge.pdf");

pdfEditor.Concatenate(outFiles, mergeFile);

}

Hi Jon,

I have noticed this problem at my end as well and logged it as PDFKITNET-20027 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,