PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 11:41 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jan 30, 2007 12:39 pm 
Offline

Joined: Tue Jan 30, 2007 12:27 pm
Posts: 3
Hi,

First of all this is my first post so just wanted to say this is a great component! I was surprised how quickly I could write to code to generate a relatively complex PDF report.

My question regards sending a report directly to the printer - I am creating a MigraDoc.DocumentObjectModel.Document object and adding to it various paragraphs, images and tables etc. and currently rendering it to a file based pdf using a PdfDocumentRenderer.

Is it possible to send this directly to a printer and if so how do I do this please?

Many thanks.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 30, 2007 1:19 pm 
Offline

Joined: Tue Jan 30, 2007 12:27 pm
Posts: 3
I think I may have answered my own question but maybe you could confirm if this is the best way?

PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer();

Document document = GetPrintableNode().GetDocument();

pdfRenderer.Document = document;

MigraDocPrintDocument printDoc = new MigraDocPrintDocument();

printDoc.Renderer = pdfRenderer.DocumentRenderer;

pdfRenderer.RenderDocument();

using (PrintPreviewDialog f = new PrintPreviewDialog())
{
f.Document = printDoc;
f.ShowDialog();
}


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 09, 2007 12:11 am 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
The sample DocumentViewer shows how to print directly to a printer.[/b]


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 179 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group