Prevent users from opening PDFs in Reader - pdf

We use a LiveCycle form, but don't utilize Reader Extensions as all of our internal users should have Adobe Pro installed. However, there are a handful (often new employees or people working from new systems), that either don't have Pro installed yet or have Adobe Reader opening PDFs by default.
Is there any way to either prevent a form from opening in Reader, or determine when a PDF is opened with Reader and display a message? The latter is ideal, as we could direct our users to see IT staff to install Pro.

This should be possible, see this link: http://www.serhatdundar.com/javascript-inside-pdf-detect-browser-acrobat-reader-version for more information.
Basically the link confirms that it is possible in Javascript (running within Reader or Acrobat) to detect which variation of the application is being used. Given that you can create PDF files with an "open script" - a script run when the file is being opened, that should answer your question.
Put an open script in all of your PDF forms.
User opens the PDF, the script is run.
The script then does the following:
Check application variation to detect Reader (as opposed to Pro)
Show dialog box with appropriate information if the variation is Reader.

Related

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.

attachment is not working in adobe reader

I have a fillable pdf with few text boxes in it and a save button. When the user fills the form and clicks the save button using Acrobat Pro I am able to save the data as an attachment in pdf, But the problem is When the user opens the pdf using Adobe Reader and try to do the same thing as above I am getting following error.
I have been searching for a week but no luck. Is there any way to make createDataObject() function work in Adobe Reader? or Is there any other way we can embed data into pdf?
Note: I am using Acrobat Javascript for this functionality. And I am using Adobe Reader version 11 and Acrobat pro version 11 and my OS is Windows.
What I have read so far is that getting file attachments working in Adobe Reader requires certain security settings to be enabled. Check out this Adobe forum post. According to it, attaching files from within Adobe Reader is only possible if you have Adobe Reader Extensions and allow users with Reader to add attachments.
I've been trying to get attachments working in Adobe Reader with Adobe LiveCycle and Adobe Pro myself, but also no luck so far. If anyone can give any workarounds, I'd be very interested in them myself.
Our workaround is to put a JS file in
/c/Program Files (x86)/Adobe/Acrobat DC/Acrobat/Javascripts/
or where ever.
This file has things like
app.PermittedFunction = function(some parameters here)
{
app.beginPriv();
Do fancy stuff here
app.endPriv();
}
app.trustedFunction(app.PermittedFunction)
Then we set button or menu Javascript actions as just
app.PermittedFunction(Generally pass in at least this so the file is clear)
And that should get you around the security errors.

Questions about PDF Form, Acrobat Reader, Browser PlugIns and JavaScript

With the latest Adobe PDF smart forms, following are my questions:
1) Could the PDF form itself detect or be aware of what client software itself is opened with?
2) When a PDF form is opened inside a browser plugin, could the script on the form read from browser cookies? and also could the script on the form write into browser cookies?
Thanks for the info.
"latest smart forms"… this has been done for the last 15 years…
To 1): The first distinction is to make whether the PDF viewer used understands (Acrobat) JavaScript.
If not, your smart form will remain dumb, and there is nothing you can change (if the viewer allows submitting data, you could do a server-side data processing and form filling and return the filled PDF to the client).
If the PDF viewer understands (Acrobat) JavaScript, you have the possibility to test for the kind of viewer, its version, as well whether it is external (which means whether you view the form under a web browser). See the Acrobat JavaScript documentation (which is part of the Acrobat SDK, downloadable from the Adobe website).
To 2): The answer is simple: no. This is not allowed (and implemented) for security reasons.
Hope this can help.
Max Wyss.

Saving the modified contents of a pdf

I've got a form that I downloaded, I'd like to prefill some content on the form (this is easy using cfpdfform).
Where it gets tricky is I would like to allow the user to modify the contents of that form, and then somehow have those modified contents accessible to me. I didnt build the source PDF so I dont know how to allow the user to "save" the new contents so they can be read.
Any ideas on where I might start on this one?
You can also use the cfpdfform tag to read/write data to a PDF file which has a form. The important thing is that the PDF document already have the form fields available, or that you add them.
I just recently completed a task where I had to have a user fill out a normal web form, and then create a filled version of an existing PDF document. It worked like a breeze!
I think that depending on what you are trying to accomplish, having the user fill out the data in a web form is less confusing than serving up a PDF and expecting them to save that to update a file on a remote server. Just my opinion, though.
http://www.cfquickdocs.com/cf8/?getDoc=cfpdfform#cfpdfform
It's possible for users to complete most PDF forms in Adobe Reader, but when user's try to save the changes they get a popup prompting them that the PDF cannot be saved and would need to upgrade to Adobe Acrobat to have this functionality.
Since Acrobat 7 (or possibly) 8 it's possible to create a form so that it can be completed and saved in reader. In Acrobat open your PDF, and select Advanced -> Enable usage right in reader from the menu. This will prompt you to save the form and then anyone using Adobe reader can complete it.
Once that's done you can open the form in ColdFusion, populate some of the fields and serve it up to the user. Once they fill it in, save it and get it back in ColdFusion you can read the contents using the PDF related tags.
Please note: It's currently not possible to set the "enable usage rights in reader" flag from ColdFusion, you need a copy of Adobe Acrobat or access to Adobe LifeCycle server to do this.
This document may help you:
http://www.adobe.com/education/instruction/teach/coldfusion/CF8-2_advanced_cf8_development_unit8.pdf

Hiding the "You cannot save data typed into this form" message in Acrobat

I am embeding a PDF form on my web application. The application allows you to fill in the fields in the form, and when you are done, click on a "Submit" button, which saves whatever you've entered into the form. This functionality is working fine.
Unfortunately, Adobe Reader displays a message on top of their embeded control that says: "Please fill out the following form. You cannot save data typed into this form. Please print your completed form if you would like a copy for your records."
Now, I know what Adobe Reader is trying to tell the user. Basically, Adobe Reader will not allow you to save the contents of what you've entered into your local hard drive as a new PDF.
However, since we've added a Submit button which effectively will save what they typed within our application, and it is working. Therefore, we think this message is misleading, and would like to remove it.
I use iTextSharp in .Net for our form automation server side. I have not found a way to remove this message from the embeded forms.
Any help?
It has been a long time, but adobe has added option to hide this annoying message.
On OSX 11.0.3, Preferences>Forms>Always hide document message bar
I'm pretty sure that there is no way around this if you want to continue to use Acrobat Reader to display the PDF. This message is built into Acrobat Reader, and I am not aware of any way to override it from the outside.
Sorry, this is more in the way of a negative answer than a positive one.
There are some third-party, free, projects that are basically PDF viewers for .NET. This would allow you to get rid of the message by avoiding Acrobat Reader entirely, although this is a large amount of work just to get rid of a message.
This one is pretty comprehensive.
Another option that I'm sure you already thought of is to just build the form on the web page, instead of using the PDF. Again, a lot of extra work just to remove a message.
Adobe Acrobat (Standard and Pro) can change PDF forms to enable Adobe Acrobat Reader users to 'fill+save' form data (instead of the standard 'fill+print').
It is a special option available when saving the PDF saying "Save PDF with extended Reader functions" (or similar... I'm translating this back from German into English).
This cannot be achieved with any non-Adobe PDF creating software (unless this has licensed that function from Adobe). The technical reason for this is that Adobe uses a digital signature to protect this function, and that you'll have to agree to not reverse engineer the key when you accept the Adobe EULA. Acrobat Reader has that key compiled into its binary, and if it verified the key, it will change the message displayed to the user indicating that the form data of this document can be saved (it will also change its behaviour and indeed save the data).
Maybe this info helps you?
Switch to View > Full Screen Mode (short cut is on a mac is ⌘L).
Although this mode hides all menus and scroll bars too, I prefer it. IMHO the reader uses far too much screen real estate on junk)