PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Using both Migradoc and PDFSharp
https://forum.pdfsharp.net/viewtopic.php?f=2&t=76
Page 1 of 1

Author:  sjohnston [ Fri Feb 09, 2007 6:09 pm ]
Post subject:  Using both Migradoc and PDFSharp

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?

Author:  Thomas Hoevel [ Mon Feb 12, 2007 8:45 am ]
Post subject: 

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.

Author:  sjohnston [ Wed Feb 14, 2007 11:49 pm ]
Post subject: 

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?

Author:  Thomas Hoevel [ Thu Feb 15, 2007 9:03 am ]
Post subject: 

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.

Author:  Stefan Lange [ Thu Mar 08, 2007 11:46 pm ]
Post subject: 

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/