Joined: 28 Aug 2007
|Posted: Tue Aug 28, 2007 9:36 pm Post subject: Printer not printing properly
|I am using PdfSharp to take 3 documents and merge them into 2. The 3 individual documents will print fine but after the merge then they don't print. The printer waits for something but I'm not sure for what.
I've put my code below that I use to combine the files.
A few notes about the code:
1. output is a custom class that just contains some info about the output that I want.
2. htFiles is a hashtable with the PdfDocument objects in it.
When I looked at some of the information about each page I noticed that the mediabox wasn't being set. Could that be a problem?
PdfDocument pdfOutput = new PdfDocument(outputName);
pdfOutput.SecuritySettings.PermitFullQualityPrint = true;
pdfOutput.SecuritySettings.PermitModifyDocument = true;
pdfOutput.SecuritySettings.PermitExtractContent = true;
pdfOutput.SecuritySettings.PermitPrint = true;
foreach (OutputPage outputPage in output.Pages)
int intTemplateID =GetKey();
int intSequence = GetSequence();
PdfDocument thisPdf =
PdfPage page = thisPdf.Pages[intSequence - 1];
page = pdfOutput.AddPage(page);
pdfOutput.Save(finalPath + outputName);
catch (Exception exc)
If more information is needed then let me know. I'll try to give as much as possible to fix this. The other alternative is using ABCpdf and I've looked at the documentation for that...