Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to export to a protected pdf just by clicking a button?

New Here ,
Aug 14, 2018 Aug 14, 2018

I need to know if I can export to a protected pdf when I mouse up a button.

TOPICS
PDF forms
5.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Aug 25, 2018 Aug 25, 2018

It's not a single-click procedure (at least, not unless you use a custom-made script to do it). You would need to export all the pages as images, then create a new PDF from those images, then password-protect that PDF, and even that is not 100% secure...

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 15, 2018 Aug 15, 2018

Depends. Can you install a script on the user's local machine?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 15, 2018 Aug 15, 2018

I mean I need a .pdf with non able to copy functions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2018 Aug 16, 2018

Copy what? The PDF itself, or its contents? The former is not possible. The latter is possible (using a security policy) but it's very easily to get around it, since not all applications adhere to these policies, unfortunately.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 25, 2018 Aug 25, 2018

Or is there a way in which all the contents of the form and shapes could be saved as image, but printed on another pdf? I need this, so the customers don't have the ability to edit quickly .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2018 Aug 25, 2018

It's not a single-click procedure (at least, not unless you use a custom-made script to do it). You would need to export all the pages as images, then create a new PDF from those images, then password-protect that PDF, and even that is not 100% secure...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 25, 2018 Aug 25, 2018

You can flatten the form, which converts all of the fields, comments (including any shapes you may have added, etc.) to regular page contents. You can save the flattened PDF to a new file. Users won't be able to edit it any easier than with an image-only PDF.

Here's a free JavaScript-based utility for Acrobat that make the process easy: UVSAR : Selective Flattener tool for Adobe Acrobat 8, 9 and X

Post again if you need help installing it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 05, 2018 Sep 05, 2018

Is there any other script that can do the same thing as this widget? I'm not allowed to install extensions in all computers since many of them have not permissions. I need it to be very simple and included in a button action. Once again, I need to save it as another document, which won't be able to edit easier.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 05, 2018 Sep 05, 2018

If you can open the JavaScript console by pressing Ctrl+J, you can enter the following line of code:

flattenPages();

and with the cursor on that line, press Ctrl + Enter, or enter on the numeric keypad. This will execute that line of code which will flatten all annotations (fields, comments, links, etc.) to regular page contents. This is not a reversible operation, so be sure to have backups before you flatten and save.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 05, 2018 Sep 05, 2018

Also, if you have Acrobat DC, you should be able to create a custom command that includes this line of code so that it's readily available. More info on custom commands: Create Custom Commands in Adobe Acrobat DC Pro - KHKonsulting LLC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 05, 2018 Sep 05, 2018

This is my actual button JS Action:

var pp = this.getPrintParams(); 

pp.firstPage = 0;

pp.lastPage = 2;

flattenPages();

pp.printerName = "Foxit Reader PDF Printer";

this.print(pp); 

I have this code available but I need to flatten to regular page contents. But I need to Add save the flattened PDF to a new file. So users won't be able to edit it any easier.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 05, 2018 Sep 05, 2018

What that print to PDF code does is essentially the same as flattening, though flattening is safer since it doesn't lose things you don't want to (boring technical explanation intentionally excluded here). If you want to flatten and save, I'd suggest saving and then flattening. Did you want the file save in an automated fashion, or did you want to prompt the user to save to a user-chosen file name and location?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 05, 2018 Sep 05, 2018
LATEST

It's not possible to specify a file name when sending the PDF to a (virtual) printer, only when saving it directly as a local file.

As George mentioned, what you're doing is not much different from just flattening and saving the file, though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines