Disable Printing in a PDF Viewer ActiveX control? - vb.net

I'm using the Adobe Acrobat PDF Viewer ActiveX (AxAcroPDFLib.AxAcroPDF) control in one of my forms to display Controlled Document PDFs and my customer would like end users to not be able to print these documents. Is there anyway to disable printing through this control?

The PDF format supports permissions and "allow printing" is one of the permissions. If you can control the PDF generation of these controlled PDFs your best bet is to disable the allow print permission for users. You can also even run existing PDFs through a conversion process to add the necessary permissions with iText, ghostscript or something similar.
Besides, even if you are able to to disable the print button on the ActiveX viewer, if the user is clever enough to realize it is merely a PDF, they could just download the PDF and print it normally.

There's a new PDF software that does this by default. You would have to save the document as .wwf rather than .pdf. If the document is already in PDF format you can re-save it in WWF format.
It's provided by the World Wildlife Foundation in an effort to reduce paper use. The end user does not need to have the software installed on their computer for it to work. You can download the software for both MAC or PC from the link below. Hope this helps!
http://www.saveaswwf.com/en/

Related

Print to pdf that is searchable and selectable from existing pdf that is selectable and searchable

I am trying to print a section of an existing pdf to a new pdf. The original is searchable and selectable but the new pdf cannot do either. I am using "adobe acrobat reader DC" and print via "Microsoft Print to PDF". Unsure if there is any other relevant information.
After searching for a period of time I could not find an answer that allows for direct PDF to PDF print.
I did find a workaround however.
I downloaded a free software called PrimoPDF. Once installed, PrimoPDF becomes a printer option within Adobe acrobat reader. I then selected my desired pages and printed to PrimoPDf instead of Microsoft Print to PDF. This Generated a .ps file. I then imported the .ps file into PrimoPDF application and was able to generate a .pdf from that. The newly generated pdf was searchable and selectable and exactly what I needed.
Hopefully someone else finds this useful in the future.
Generally refrying (printing to PostScript then converting back to PDF) is a bad idea. The reason that Microsoft Print to PDF created a file that wasn't searchable is because when Adobe Reader detects that the printer it is targeting isn't capable of rendering the PDF correctly because of any number of reasons, like it doesn't have the right fonts for example, it will render the PDF itself and send an image to the printer. A simpler PDF probably would have worked just fine.
You are much better off getting a tool that will simply allow you to extract the pages you need to a new file rather than printing.

Force a webbrowser to display a PDF file only on Adobe Acrobat Reader

I create a PDF with iTextsharp and then I show the preview of the PDF inside a webbrowser control. From the preview the user can SAVE or PRINT using the defaults Adobe Reader's buttons
Working on Windows x64 bits with Adobe Reader as the default PDF viewer everything works fine.
The same program on a Windows x64 bits but with Foxit Reader as the default PDF open the file on Foxit Reader on full application window, outside my program.
I need to manage that.
My code is like
Dim PathToPDF As String
PathToPDF = DirectoryOfMyApp & "\ReportPreview.pdf"
ReportPreviewWebBrowser.Navigate(PathToPDF)
Where DirectoryOfMyApp just gets the C: or D: letter of the hard disk.
I read this link
How to start an Adobe Reader or Acrobat from VB.NET?
but a line like
ReportPreviewWebBrowser.Navigate("acrobat", PathToPDF )
didn´t work and I think the webbrowser control don´t have the option to choose the PDF viewer
https://msdn.microsoft.com/es-es/library/system.windows.forms.webbrowser(v=vs.110).aspx
Is there a way to set the webbrowser to use Adobe Acrobat Reader only or to force any other PDF viewer to show the PDF inside the webbrowser control?
I agree with Zaggler on his comments on this. You are making assumptions at a certain point on software that is installed on an end user's computer. Unless you are going to make the application's PDF viewer be part of a dependency installation or cooked into .NET you cannot guarantee they have that program to use. Nor can you guarantee it's installed location.
However there is a cheap hack for Windows based processes you can do in VB.NET. You can use the ole System.Diagnostics.Process()
Sub Main()
Dim nProcess = New System.Diagnostics.Process()
nProcess.Start($"D:\PdfFile.pdf")
End Sub
In this example I did a quick file location, you can try to ensure it is a valid location that will not change or is in your app's running process folder. This is really low tech as far as development goes, but it is basically saying: "Run me a process, any process, at this location. I don't care what it is, use the Windows defaults to determine what to do with it."
So when I run this on my Windows 10 Dev box it loads up Edge to display it, at home it would fire up Adobe Viewer. It is just opening the file essentially with the OS's choice of what is using that file extension. Not glamorous or very good for hardened code but it works when you want something quick to happen.
No, you can't do this.
You can't even guarantee that Adobe Reader is installed at all.
Reader might not even exist on the machine. It's not built into Windows, and not everyone uses it. Even if it is, FoxIt isn't the only alternative. A big one is that Chrome includes it's own PDF viewer.

prevent copy if pdf document (generated from word)

I'm a converting my Word document into pdf using the built-in microsoft office converter (save as--> pdf).
I want my pdf to be protected (users cannot copy text from it). i can't seem to find any options for this when converting to pdf.
Any hint?
Thanks.
Found it, Can be done with Adobe Acrobat Professional, not the Acrobat Reader.
PDF, or portable document format, forms were created by Adobe as a form of universal file format. Adobe Acrobat Reader, which allows you to view PDF files, is available for free download. Unfortunately, to manipulate documents and perform functions like changing security settings, you must have the full Adobe Acrobat software. With it, you can create secure PDFs, but you can also change security settings on PDF forms.
You can use export to PDF feature in LibreOffice, just set permission password and then disable Content Copying.

Jasper report: disable pdf toolbar when generating a pdf

Is it possible to disable the pdf toolbar when generating a pdf from a Jasper Report?
Is your PDF being opened by an external PDF Reader, like Adobe or Foxit?
If so, then I don't think so, this is the toolbar of the application itself.
On the other hand you can use PDF Viewer, a viewer that comes integrated with JasperReports. This one you can control. But then you will limit the user if he wants to do anything with the PDF.
In my own experience, I way keep it. If you remove it, the customer will soon ask for tools to zoom in and out, and maybe even to annotate.

difference between microsoft report viewer and adobe pdf reader tools?

i would like to display a pdf on my winform and am thinking of using of those tools in my vb.net application. does anyone know the difference between the two?
Microsoft Report Viewer reads report definition files and displays the report. Adobe's PDF reader displays PDF files.
Report definition files != PDF files, so you would need to make sure that you use the right tool for the right job. If you need to read PDFs, use a PDF reader.
As for consuming a PDF on a WinForm, you could host a WebBrowser control and point to the PDF. Alternately, there are several WinForm control manufacturers that read and display a PDF file (though I've not used any of them so would not be able to recommend one over another). Examples would be:
http://www.tallcomponents.com/
http://www.skysof.com/