PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 16, 2024 4:37 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Aug 28, 2007 9:36 pm 
Offline

Joined: Tue Aug 28, 2007 9:26 pm
Posts: 1
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?
Code:
PdfDocument pdfOutput = new PdfDocument(outputName);
                        try
                        {
                            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 =
                                    (PdfDocument)htFiles[intTemplateID];
                                PdfPage page = thisPdf.Pages[intSequence - 1];
                                page = pdfOutput.AddPage(page);
                            }
                            //Save Pdf
                            pdfOutput.Save(finalPath + outputName);
                        }
                        catch (Exception exc)
                        {
                            //Error handling
                        }
                        finally
                        {
                            pdfOutput.Close();
                        }


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...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 64 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group