View previous topic :: View next topic |
Author |
Message |
EdWin1409
Joined: 24 May 2007 Posts: 1
|
Posted: Thu May 24, 2007 9:04 pm Post subject: Create overlays with PDFsharp |
|
|
Hi,
I need to place two pdf documents over each other. I have a pdf (invoice with company header and footer) and another pdf with document data. Is it possible to place the invoice in the background and the other pdf over the invoice so I can see both pages ? I know that the pdf standard supports this feature, it is used for example in 'pdfbox', a java lib for creating and manipulating pdfs. Another requirement is that the resulting pdf must be editable, so I can't use image overlay.
Greetings,
EdWin |
|
Back to top |
|
|
peteratoce
Joined: 20 Feb 2007 Posts: 5
|
Posted: Tue Jun 19, 2007 6:47 am Post subject: |
|
|
Hi EdWin,
you simply create a New PdfDocument and add a page to it. Then you declare XPdfForm.FromFile(InFile) and XPdfForm.FromFile(OverlayFile). Finally you declare an XGraphics.FromPdfPage(page) and use XGraphics.DrawImage to "paint" the XPdfForms, i.e. the contents of the desired pages from both InFile and OverlayFile onto the new page.
You may have to experiment with the order in which you add content from both files, if objects overlap and thus become partly invisible for the wrong order.
Peter |
|
Back to top |
|
|
|