Captain Kenpachi
Captain Kenpachi

Reputation: 7215

Using a PDF template with PDFSharp and/or MigraDoc

I was wondering whether it would at all be possible to have our creative department design a nice-looking PDF template for our client, e.g. a fancy letterhead, then supply it to me so I could inject various types of content into the body using PDFSharp or MigraDoc.

Currently we generate the header and footer content as part of the rendering process, and it works very well, but as you can imagine, any non-trivial layout and styling is pretty complicated to pull off in what is essentially a 2D graphics environment.

So the thought arose as to whether one of these tools would be able to take a pre-existing PDF, give me access to various objects, and allow me to e.g. replace certain text placeholders or manipulate the PDF "DOM" in a more intelligent fashion.

Something similar to working with Spreadsheets (binary and XML versions) or OpenXML, etc.

Upvotes: 2

Views: 4374

Answers (1)

What we do: take an existing PDF page, draw it at the bottom (Z axis) of a new PDF page, and then use MigraDoc to add other contents to the page.

PDFsharp can also be used to draw on top.

The template PDF pages are used like letter heads with the corporate design of a customer and the final document will have as many pages as needed.

Upvotes: 2

Related Questions