Some source PDFs produce a StackOverflowException when I try to use the Linearize option:
// PDF can be found here:
// http://www.snb.ch/d/download/publikationen/ref_000706_ri.pdf
PdfDocument pdf = new PdfDocument("ref_000706_ri.pdf");
MergeDocument md = new MergeDocument(pdf);
// Leads to: "Process is terminated due to StackOverflowException."
md.PdfFormat = PdfFormat.Linearized;
md.Draw("out.pdf");
Regards,
Nicolas
StackOverflowException with PdfFormat.Linearized
Re: StackOverflowException with PdfFormat.Linearized
Support · May 30, 2006Hello Nicolas,
We were able to recreate the same exception. The PDF has been forwarded over to the developers and they are looking into it further to find out whether the problem is within the PDF or not.
We have been able to narrow down the problem in the PDF. The issue is with the last six pages having charts. When merging the PDF without those last six pages, the PDF is linearized without any problem.
As a workaround for now, you can merge the PDF without using the PdfFormat.Linearized property.
Thanks,
ceTe Software Support Team
Re: StackOverflowException with PdfFormat.Linearized
Forum member · Aug 17, 2010Hello! I use PDF library for linearizing PDF-document and have the same problem. That's my code:
PdfDocument pdfDoc = new PdfDocument(oldPath);
Document tempDoc = new Document();
foreach (PdfPage page in pdfDoc.Pages)
{
ImportedPage imPage = new ImportedPage(page);
tempDoc.Pages.Add(imPage);
}
tempDoc.PdfFormat = ceTe.DynamicPDF.PdfFormat.Linearized;
tempDoc.Draw(newPath);
I can send my PDF-file to us for analyze. Where can I upload or send my file?
Re: StackOverflowException with PdfFormat.Linearized
Support · Aug 17, 2010Hello,
Please make sure that you are using the latest DLL files from the website corresponding to the version you are using.
Can you please send an email to our [^a|mailto:support@cete.com|Support Team^] with the PDF document, so that they can take a look at the PDF and identify what is causing this exception? Also please let us know what version of our product are you using.
Thanks,
ceTe Software Support Team