Append not working

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
jakebyte
Posts: 2
Joined: Tue Sep 18 2007

Append not working

Post by jakebyte »

I have 2 PDF files that were generated through SQL Server 2005 Reporting Services. I then modify the files with PDFCreator to update the subject, title, creator, author, and keywords such as: PDFDocument.AttributeByName("Title").Value = sTitle;

I then take these 2 files and append them into a new file. However, the new file always comes out corrupt / when I open it in Adobe Acrobat it shows rectangular boxes for all my text. The pages are still there, but the text is all corrupted.

I also noticed that this happens if I just take the PDF file straight from Reporting Services and don't modify it all, but simply append the file to another PDF file that after 3 or 4 times the appended PDF pages get corrupted.

So if I modify the attributes appending will always corrupt the file. If I don't modify the attributes appending will corrupt the file after 3 or 4 appends.

Here is some test code I use to append the files.

System.IO.FileStream file1 = new System.IO.FileStream(@"c:\test.pdf", FileMode.Open, FileAccess.Read);
Amyuni.PDFCreator.IacDocument doc1 = new Amyuni.PDFCreator.IacDocument(null);
doc1.Open(file1, "");
System.IO.FileStream file2 = new System.IO.FileStream(@"c:\test1.pdf", FileMode.Open, FileAccess.Read);
Amyuni.PDFCreator.IacDocument doc2 = new Amyuni.PDFCreator.IacDocument(null);
doc2.Open(file2, "");
doc1.Append(doc2);
System.IO.FileStream file3 = new System.IO.FileStream(@"c:\newfile.pdf", FileMode.Create, FileAccess.Write);
doc1.Save(file3);


Any ideas???
jakebyte
Posts: 2
Joined: Tue Sep 18 2007

Found Append issue

Post by jakebyte »

I found the issue with Append, and it ends up not being a problem with append, but may be an issue with Save???

The 2 documents I had created came from SQL Server 2005 Reporting Services, then I modify a few attributes and save the PDF files using:

PDFDocument.Save(fsNew, Amyuni.PDFCreator.IacFileSaveOption.acFileSaveAll);

If I take out the acFileSaveAll option everything works fine. If I add the acFileSaveAll option it somehow corrupts the PDF file so that I am unable to append the files that were saved with the acFileSaveAll option.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Your original PDF files not being generated by the Amyuni products there might be a slight chance that these files are not support by the version of PDF Creator.net you are using.

In general when our customers com accross a PDF file that is not supported by our driver we ask them to send it to support@amyuni.com so our developers can check it.

If you are using an old version of PDF Creator.Net, updating or traying the latest version may resolve you problems a high percentage of unsupported files in older versions are already supported in 3.01a.

Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Post Reply