Skip to main content
New Participant
December 20, 2012
Question

How to print password protected PDF files to a new PDF using Visual Basic for Applications

  • December 20, 2012
  • 1 reply
  • 25820 views

I have a series of PDF files that are password protected. I have a login ID and password that allows me to view the documents once I've logged in, but my co-workers that don't have login credentials cannot view the documents. What I'm doing in order to make the documents viewable for others is a manual process that I'm looking to automate using Microsoft Access 2003 VBA. Here's the manual process:

1.) I set my default printer to be the "Adobe PDF" printer.

2.) I open Windows Explorer and navigate to the folder that contains the password-protected PDF files, selecting all of them.

3.) I right-click on the selected group of files and choose "Print" from the context sensitive menu that appears.

4.) I provide my ID and password in order to access the password-protected files - I only have to do this once.

5.) In the "Save PDF File As" dialog box that appears, I choose where I want to save the first file and the applicable file name and click "OK".

6.) I repeat Step 5 until all of the PDF files have been printed as "new" PDF files with new names that are no longer password protected.

I know how, using Microsoft Access 2003 VBA, to navigate to a particular folder on a network drive and loop through each file within the folder. What I don't know how to do is to print each individual PDF file using the Adobe PDF printer so that it's printed as a new PDF file that's no longer password protected.

This topic has been closed for replies.

1 reply

Brainiac
December 20, 2012

(Sorry, I think my reply was useless to you. This is not a PDF password, but an external password. Is that right?)

JDGUILTYAuthor
New Participant
December 20, 2012

You are correct - the password is an external password. When I go to open one of the PDF files that are pasword protected I'm greeted with a dialog box (the dialog box displays "Login In To Restricted Document" in the title bar), which is where I provide my user name and password as part of the Adobe LiveCycle Right Management credentials.

Brainiac
December 28, 2012

I would just ask the 3rd party that created the PDF if they could supply unencrypted files. If there is some reason they will not, I am surprised that they have not restricted printing. Normally when Acrobat security is set, you can not print to a new PDF, even if printing is allowed. One option is to provide the ID and password to the other folks who need to review the PDFs. On the surface, there seems to be a license issue with what you are trying to do and you may need to be careful that the company is not at risk. That is why I am suggesting to coordinate with the 3rd party.

Sorry. I don't have a solution but just the statement of concern.


The workflow being described here would have the effect of removing DRM protection on a file, and irrespective of your motives in this particular case, NO discussion of how that could be achieved is permitted on these forums.

Contact the supplier of the original documents and arrange access for your colleagues.