How make PDF Viewer for winforms C# - c#

Any PDF Libray or OCX for Read PDf Files and show winform. I dont want user ActiveX Acrobat because i need install Acrobat Reader.
I need to hide save and print buttons too. Will open PDF encrypted.
I really liked Foxit SDK ActiveX more very expansive $3000usd. Apitron is free but it LOSS OF RESOLUTION WHEN OPENING PDF. (i already set it for renderingQuality = high)
Someone know ?

You can check out the Document Viewer from the LEADTOOLS Nuget here:
WPF Viewer: https://www.nuget.org/packages/Leadtools.Document.Viewer.Wpf/
WinForms Viewer: https://www.nuget.org/packages/Leadtools.Document.Viewer.WinForms/
Just as a disclaimer, I am an employee of this vendor.
It supports viewing PDFs and other document and image formats as document or image. This works without any installations or running ActiveX components.

You can evaluate PDF Viewer controls for WinForms/WPF by DevExpress. You can easily customize these controls as your needs dictate.
PDF Viewer for WinForms
PDF Viewer for WPF

Related

Why PDF exported from Report Viewer opens in different zoom size in Adobe Reader

I have 16 Reports in my current application. when I export the reports
through Export drop down menu to PDF file, it saves to my local disk.
But when I open the PDF through Adobe Acrobat Reader it opens it with
a different zoom size for each report. Why I am getting this kind of
behavior.
Can I set a default zoom size for all the generated PDF
dynamically ??
You can't change the zoom level of generated PDFs in Reporting Services.
The zoom is managed by the viewer application, which is Adobe Acrobat Reader in your case.
There is no details about it in the documentation because this feature does not exist, but here is a link to a question on MSDN forums where somebody from Microsoft confirms that there are no ways of doing it:
export SSRS report to pdf / controlling zoom
right click on report and
1) go to report properties
after that you set height and width as per your requirement

Display a PDF in winforms [duplicate]

This question already has answers here:
Viewing PDF in Windows forms using C# [closed]
(5 answers)
Closed 7 years ago.
I am trying to display a PDF in a winform using C# .net
I have included the iTextSharp Library, and successfully opened the PDF file, however I get a byte[] back from iTextView
PdfReader reader = new PdfReader(GetURI("test.pdf"));
reader.getPageN(1); //returns byte array
I can't find much documentation on this library, and I was wondering how I would get the PDF on the actual form, be it in a picture box or a webview. How do I display the pages of the PDF?
EDIT:
I Don't want to open it in a third party reader
I don't want dependencies on adobe reader
I want to focus on a solution with iTextSharp or something similar, as I need to secure the PDF, encrypt it and eventually alter it.
You can easily display PDF in WebBrowser control. Add a webBrowser control to your Winform. Add the following method to your form.
private void RenderPdf(string filePath)
{
if (!string.IsNullOrWhiteSpace(filePath))
{
webBrowser1.Navigate(#filePath);
}
}
Call this method by passing PDF file path,
RenderPdf(#"PDF path");
ITextSharp allows you to create and manipulate pdf's, but does not provide any rendering options like Bradley Smith said in a comment above
I did something similar a long time ago and what I ended up doing was using Ghostscript to generate a tiff image from my pdf and displaying that instead. Obviously that just displays an image so if you need to edit the pdf, this won't work for you.
Ghostscript is command line only so I think you have to run it something like this:
Process.Start(#"c:\gs\gs.exe",
String.Format("-o {0} -sDEVICE=tiffg4 -dFirstPage={1} -dLastPage={2} {3}", "tiffPages.tif", fromPage, toPage, "inputfile.pdf"));
This question is a copy of this
The answer I found:
i think the easiest way is to use the Adobe PDF reader COM Component
right click on your toolbox & select "Choose Items" Select the "COM
Components" tab Select "Adobe PDF Reader"
then click ok Drag & Drop
the control on your form & modify the "src" Property to the PDF files
you want to read i hope this helps
what about using a viewer control from any vendor? Found it on the first page in google: viewer control for windows forms
If a commercial library is an option, try Amyuni PDF Creator .Net. You will be able to display your PDF document in a form, modify the document or encrypt it. You will not need to rely on any other program to be installed, or any external processes.
As other answers and comments have mentioned, iText is not designed for displaying PDF documents.
Disclaimer: I work for Amyuni Technologies.

Convert MsWord first page to Image

I have an msword document that consists of some pages, i need convert only the first page to image and save it. Each page can consist of images, tables, text, etc. But i can't use clipboard buffer or any commercial software.
May be anybody know some other ways ?
You can turn on the "Generate thumbnail for Document" option and word will generate an image for you (that Windows 7 uses to show the large icon view of the document.
In word 2010, click File-Info
then the Properties Drop down
Then Advanced properties
Then Summary tab
and finally SHOW PREVIEW PICTURE
And what's worse, you can't automate it! Ugh, Something about a security risk.
When you do that, there will be an extra WMF file embedded within the DOCX that you can extract.
Print your first page to the Microsoft Office Document Image Writer.
It will give you a TIFF image.
EDIT
Alternatively, print to the Microsoft XPS Document Writer and then convert XPS to an image.

View PDF through C# .Net desktop App

I want to know how I can view a PDF through a C# .net desktop App. I am trying to create a application to view PDF using visual studio 2008
There is a pdf reader libraries called iText(iTextSharp). But it didn't help me
You can host a ie web browser control in your application and that will allow the user to view a pdf if they have a reader installed.
I can provide an example if you tell me whether you are using WPF or WinForms.
Drag WebControl on to you form
Set the path in code
Done Press F5
I'm not sure what netbeans has to do with anything, but take a look at this question here How to render pdfs using C#
Essentially you need to get a 3rd party PDF viewer or write one yourself. There are quite a few around and would probably take a look at something like PDFViewForNet
iText isn't a PDF viewer.
If you want to read PDF documents in your application there are couple of Open Source PDF Libraries.

C# PDF Control & Library

I'm looking for a way to display a PDF (similar to a picture box), in a Windows Form. After that I need to be able to create a PDF. What's the best library for the job for creating the PDF (from simple text)? I've taken a look at several and I'm not sure which one is the best. Preferably open source. As for the control, I tried the COM object Adobe provides... I can't seem to get it working. At all. I've tried loading several files, there are no errors. It simply fails to load.
PDF Sharp, Sharp PDF and iTextSharp are excellent. They are all OpenSource.
To answer your question about getting the PDF to render, you could use a WebBrowser Control on your form as long as the client workstation has Adobe Reader installed. The browser will automatically pick up the MIME type and load the in-browser Adobe Reader.
For rendering, I echo Will Marcouiller and SLaks. We have had good success with PDFSharp.
For creating pdf's iTextSharp is very good, and it's free too.
I worked with SharpPDF and it did great job. And it's open source.

Categories

Resources