protecting pdf files with user / owner passwords ?

Posted on 2005-05-13
Last Modified: 2012-05-05
Is it possible to protect pdf files (NOT ps files) with user / owner passwords programmatically?
Any links to API / source code would be helpful.
I am using Acrobat 7.0 full version and I have SDK also.
A solution in VB/VBA would be preferable.

Where can I get the help regarding PDFMAKERAPILib API?

Advance Thanks and regards,

Question by:vrkorada
    LVL 44

    Accepted Solution

    There is no API for doing this with VB. The PDFMaker macro is not for 3rd party development. Acrobat has a number of published and supported interfaces, teh PDFMaker is not one of it. Adobe decided not to document this interface, so you an only use it by clicking on the buttons in the different applications.

    You can set the user and owner passwords with 3rd party software. One option is the open source software pdftk ( which can apply passwords, another option is the activePDF Toolkit (, which does provide a COM object, so you could use this from within a VB/VBA program.

    Author Comment

    Presently I am using pdftoolkit only. But I am looking for an API so that I can use it in VBA and .NET applications.
    The problem with running pdftoolkit as shell command is that we do not have any control on the job progress. In my applications I want to remove the unprotected source pdf file after setting the password using pdftoolkit. This is creating problems some times.

    LVL 44

    Expert Comment

    by:Karl Heinz Kremer
    Have you looked at the activePDF Toolkit (I provided a link in my first response)?
    LVL 1

    Assisted Solution

    iText API for Java can encrypt PDF files. There is only password to access the PDF file, no user name.
    LVL 44

    Expert Comment

    by:Karl Heinz Kremer
    The problem with the "normal" version of iText is that it's a Java library, and can therefore not be used from within a VB or .NET application. However, the whole library was ported to .NET:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
    This article is in response to a question here ( at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
    In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
    In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now