I am using ABCpdf7 to insert a table of contents at the beginning of another PDF Doc. I can't use Doc.Append() because it temporarily duplicates the large base PDF in memory, so I am doing the following (which I based on the info for AddImageDoc from http://www.websupergoo.com/helppdf7net/):
Doc toc = LoadSubReport("someTableOfContents.pdf");
for (int i = 1; i <= toc.PageCount; i++)
{
Report.Page = Report.AddPage(i);
Report.MediaBox.String = toc.MediaBox.String;
Report.Rect.String = toc.MediaBox.String;
Report.AddImageDoc(toc, i, null);
}
This adds the pages from the table of contents pdf correctly, but a few pages into the original document, the pages appear damaged or missing. Here's what I see in Reader for the remainder of the document (the little squares are the remaining pages):
What is causing this? Is there a better way I can insert the table of contents pages?
I was using ABCpdf 7022. Installing 7042 fixed the problem.
For anyone else concerned with related problems, a suggestion I got from ABCpdf support was to use Doc.Append to add the table of contents to the end, then Doc.RemapPages to move it to the start of the PDF.