PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DocumentViewer example and using PrintDocument to print

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
erik_buchanan@yahoo.com



Joined: 20 Feb 2009
Posts: 8

PostPosted: Mon Jun 01, 2009 3:11 pm    Post subject: DocumentViewer example and using PrintDocument to print Reply with quote

Instead of creating an rtf or pdf and then printing I'm trying to work from the DocumentViewer example and create and print a MigraDoc PrintDocument and print from there. I'm working in a browser in evironment not windows forms. Any help at at all would be great.

I keep running into the error
Object reference not set to an instance of an object.
Line 1685: printDocument.Print();


// Reuse the renderer from the preview
ddl = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(document1);

DocumentRenderer renderer = new DocumentRenderer(document1);
if (renderer != null)
{
//int pageCount = renderer.FormattedDocument.PageCount;

// Creates a PrintDocument that simplyfies printing of MigraDoc documents
MigraDocPrintDocument printDocument = new MigraDocPrintDocument();
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.PrintRange = PrintRange.AllPages;

// Attach the current printer settings

// Attach the current document renderer
printDocument.Renderer = renderer;

// Print the document
printDocument.Print();
}
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com