View previous topic :: View next topic |
Author |
Message |
chrisb
Joined: 30 Jan 2007 Posts: 3
|
Posted: Tue Jan 30, 2007 12:39 pm Post subject: Rendering Document straight to printer |
|
|
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. |
|
Back to top |
|
|
chrisb
Joined: 30 Jan 2007 Posts: 3
|
Posted: Tue Jan 30, 2007 1:19 pm Post subject: |
|
|
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();
} |
|
Back to top |
|
|
Stefan Lange
Joined: 12 Oct 2006 Posts: 47 Location: Cologne, Germany
|
Posted: Fri Mar 09, 2007 12:11 am Post subject: |
|
|
The sample DocumentViewer shows how to print directly to a printer.[/b] |
|
Back to top |
|
|
|