Print Preview Control

crazymonk24

New member
Joined
Jun 24, 2006
Messages
2
Programming Experience
Beginner
Okay ladies and gentleman I have to apologize ahead of time if this is too easy for you. I have a pdf file saved and a print preview control on my form. How do I preview the pdf on my print preview control. Thank you
 
You don't. The PrintPreviewControl is for previewing printed pages that you create yourself using a PrintDocument and GDI+. As far as your app is concerned a PDF is a binary file and if you wanted to be able to display it using a PrintPreviewControl you would have to read and interpret that binary data and then use GDI+ to draw a representation of it.
 
I wouldn't. I'd simply open the PDF in Adobe Reader, or whatever the default application for PDF files was, by passing the file path to Process.Start. Alternatively you could search for a third-party library that deals with PDF files. I'm sure there are numerous examples around but I'd guess that many of them will cost. iText# is one third-party PDF library that doesn't cost money but I'm not sure whether it will do what you need or not. Only one way to find out though.
 
Back
Top