I'm looking for .NET GUI component (different than PDFsharp) allowing preview PDF 1-page document.
Basically I need something similar to PictureBox where I can load bitmaps and show it.
It would be great if that component allows zooming and moving picture inside.
Freeware solutions preferred :)
Open Acrobat or Acrobat Reader. On the Edit menu, choose Preferences. In the Preferences dialog box, choose General in the Categories list, and then select the Enable PDF thumbnail previews in Windows Explorer check box.
Once you've downloaded your PDF and opened it in Reader do the following: Select View > Page Display > Two Page View (or Two Page Scrolling if you prefer). Select Show Cover Page in Two Page View.
Here's what you need to check: Verify that Show preview handlers in preview pane checkbox is checked. Make sure the checkbox Always show icons, never thumbnails is unchecked. In the Open File Explorer to dropdown under the General tab, choose This PC instead of Quick Access.
Find the PDF you want to open in your Files and double click to open. Select Adobe Acrobat (or whichever reader you downloaded) from the list of available options. If no list appears or the page opens in another application, you can right-click the file and select Open With to choose your PDF reader. Click Open.
Another option is to use the WebBrowser control in your GUI. It's going to use the browser to render the PDF, but I'd do that route rather than mess around with the Adobe Reader ActiveX component.
If you don't want any type of PDF reader available on the client, you could also convert it to a graphic file through GhostScript and display it as a bitmap.
you can use activex component that comes with Acrobat Reader.
How to render pdfs using C#
Question is rather old, but proposed solutions have significant drawbacks:
Fortunately free alternative exists: poppler tools (based on xpdf codebase) which are licensed under GPL and may be used as console utility. From .NET code it may be executed with System.Diagnostics.Process.
To simplify poppler tools usage we've developed NReco.PdfRenderer .NET wrapper that embeds poppler windows binaries (they're extracted on first use) and provides simple API for rendering PDF pages to image:
var pdfToImg = new NReco.PdfRenderer.PdfToImageConverter();
Image firstPageImg = pdfToImg.GenerateImage( "test.pdf", 1);
Component is not free, but its pricing is very reasonable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With