PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 3:14 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Nov 23, 2010 2:51 pm 
Offline

Joined: Wed Nov 17, 2010 12:08 pm
Posts: 5
Hi,

I have this problem when i try to create 2 pdf-documents in one method.

I first go like Document document = new MigraDoc.DocumentObjectModel.Document(); and create a "none-printer" version.

After that i try Document printdocument = new MigraDoc.DocumentObjectModel.Document(); to create a printer version with the same text-information,
but this second document get blank and adds the first one as new section so when i try to print it out i get 2 pages, one blank and one with the none-printer version.

Anyone know what can be wrong ?

Regards

Texxan


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 23, 2010 3:28 pm 
Offline
Supporter
User avatar

Joined: Thu May 27, 2010 7:40 pm
Posts: 59
Location: New Hampshire, USA
There's not quite enough info to go on here, but if you create 2 Documents, then set about populating both of them, make sure you x.Clone any objects you add to the second document.
You can't create an object (like a paragraph) and add it to both documents without cloning it.

Any chance this is the issue?
-Jeff


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 24, 2010 8:00 am 
Offline

Joined: Wed Nov 17, 2010 12:08 pm
Posts: 5
jeffhare wrote:
There's not quite enough info to go on here, but if you create 2 Documents, then set about populating both of them, make sure you x.Clone any objects you add to the second document.
You can't create an object (like a paragraph) and add it to both documents without cloning it.

Any chance this is the issue?
-Jeff


Hi Jeff!

Im not sure, but what I whant to do is to create an entire new docuemt. The first one has a background-image which the second one is not suppose to have.
I was thinking the "new MigraDoc.DocumentObjectModel.Document();" created an all new PDF-file, but thats may not be the case ?

Regards

Texxan


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 24, 2010 8:23 am 
Offline

Joined: Wed Nov 17, 2010 12:08 pm
Posts: 5
I found out was the problem was, i was useing the same PdfDocumentRenderer :) hehe, thx for the help anyway Jeff!


Regards

Texxan


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 35 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group