简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM