PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Mar 03, 2021 7:46 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Feb 09, 2007 6:09 pm 
Offline

Joined: Fri Feb 09, 2007 6:06 pm
Posts: 2
I want to create a document using both packages. I cannot for the life of me find a sample that uses both packages on one document.

Basically, I have an invoice that I want to draw some graphics by using XGraphics.

Any easy solutions?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 12, 2007 8:45 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3047
Location: Cologne, Germany
We use MigraDoc to create the document. For example we leave some pages blank.

Then we use PDFsharp to add XGraphics later. Now we fill the blank pages with pages from other PDF files.

This is not an elegant solution, but it works. And PDFsharp works fast.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 14, 2007 11:49 pm 
Offline

Joined: Fri Feb 09, 2007 6:06 pm
Posts: 2
So just to confirm, you use the DocumentRender, add the migradocument as the document, and then render the document? At what point do you reference the blank pages, and add the XGraphics?

Just seems like a common task where you would want to have a high level document, such as an invoice or a report, that you would also want to add graphics to such a document.

Any other suggestions, or shall we add this as a requested enhancement?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 15, 2007 9:03 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3047
Location: Cologne, Germany
AFAIK there is no interface to include XGraphics in MigraDoc documents.
I guess this has historic reasons. In the beginning there was MigraDoc, but without PDFsharp. Then we developed PDFsharp as a replacement for the PDF library we used before.
And: MigraDoc is a document generator for PDF, Word, and HTML. XGraphics are specific to the PDF renderer are not (currently) supported by the other two.

MigraDoc has a charting module. I don't know exactly how it works, but this is one way to include graphics.

MigraDoc supports various images. Creating a PNG file for inclusion in MigraDoc is another way.
This is how you add logos, but you can also add individually created graphics like charts etc.

Creating a PDF file with MigraDoc with blank pages or blank areas on pages is another way. After MigraDoc has completed, you can open the file with PDFsharp, access individual pages and add your graphics.
This is easier than it sounds - but not as easy as it could be.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 08, 2007 11:46 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
You can create a MigraDoc document and render a page or a single paragraph using an XGraphics object.

Search for class ShapesMigraDocObject in XGraphicsLab, that will give you some hints how to do it.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 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