PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 6:47 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Dec 02, 2010 12:49 pm 
Offline

Joined: Thu Dec 02, 2010 12:30 pm
Posts: 1
Hi

I'm currently working an ASP.NET project which has the following requirement.

Take an already existing PDF file, dynamically add a name and address to a label space left on the PDF, then send the PDF for printing.

With this running on a web server I want to if possible resist saving the version of the PDF with the address as it won't be required anymore after printing. Using adobe reader for printing is not an option, as this will be a multi user, print queue style system so don't want to have multiple copies of adobe reader opening and closing on the web server (and the admin guys will probably not allow it anyway).

I previously worked with PDFSharp before the merging with MigraDoc and so know that can do the PDF editing using PDFSharp, and reading about MigraDoc I see that it can do previewing and printing so my current attempted approach is:

* Load the templace PDF into a PDFSharp document
* Dynamically add the address text to the PDF
* Create a MigraDoc document from the PDFSharp document (if possible in memory)
* Print the MigraDoc document using MirgraDoc Printing.

I have completed the first 2 steps fine, and can get MigraDoc to render the PDFSharp document and save it by using the PdfDocumentRenderer.

But I can not get MigraDoc to print it, I have been trying to use a MigraDocPrintDocument... as shown in the Migra printing example.

I have hit a brickwall at this point, I thought I was nearly there having MigraDoc render and save the PDF, but can not get it to print. So is it possible to transfer a PDF Sharp document to a true MigraDoc document for printing or can I print from a PDFDocumentRenderer? and if either of these are possible how?

I know I could add the address text to a PDF using MirgraDoc adding it (I think) as a section/paragraph item, but can't work out how I would load the original PDF into a MigraDoc document?? I've only seen about loading a PDF from one of its DLL files?

Thanks for any help
Michael


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 02, 2010 3:15 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

MigraDoc can print, but AFAIK it cannot print PDF "images" used in the document.

You can use PDF pages with MigraDoc to create new files, but you'll need a different tool for printing.

Or convert your PDF pages to real images (bi-level, e. g. 300 dpi).
The fixed text will come from the image, then MigraDoc will draw the variable text over the image.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 52 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