Start search

How to protect multiple PDF files with a password at once?

Introduction

AVS Document Converter supports the command line mode, therefore allowing you to automate processing of your documents. This can be useful if you often have to work with multiple documents of different formats, for example, if you need to prepare them for printing, sending via email or publishing on the web.

Launching AVS Document Converter via the command line, you can quickly and easily perform the following tasks:

  • convert a lot of files at once to a necessary format,
  • merge a number of text documents into a PDF file,
  • protect your files with a watermark,
  • set a password to avoid unauthorized access to your PDF files,
  • restrict editing, printing and copying content of your documents,
  • create e-books in ePub, FB2 or Mobi formats.

This guide describes how to enable password protection for several PDF files and prevent them from being edited, printed or copied using AVS Document Converter in the command line mode.

Even if you have never worked with Command Prompt before, you will easily cope with such a task following our instructions. Just use an XML file example that contains the conversion parameters, make a quick correction to it changing some values and then automatically convert any number of files according to this preset. You can use the same preset for new files conversion whenever you wish.

Step 1: Download and install AVS Document Converter

Click here to download it. After the download is finished, run the AVSDocumentConverter.exe file and follow the installation wizard instructions.

Please remember the path to the installation folder as it will be necessary later.

[Back to the Top]

Step 2: Add files for conversion

Put all the documents you need to protect with a password into a folder on your computer HDD.

[Back to the Top]

Step 3: Create an XML file

For your convenience, some XML file examples are included into the AVS Document Converter installation and can be found in the program installation folder (by default it is C:\Program Files\AVS4YOU\AVSDocumentConverter\examples or C:\Program Files (x86)\AVS4YOU\AVSDocumentConverter\examples for a 64-bit version of Windows).

Note!Note: the \AVSDocumentConverter\examples folder also contains a number of .BAT files. For a quick demonstration of the command line conversion opportunities, you can launch any of them by double-clicking the file.

If you do not know how to create a new XML file, just copy the appropriate example, open it using any text editor, adjust some configuration parameters depending on your current task and save the changes.

Below you can see an example of the XML file content which includes all the necessary parameters for the entire conversion process.

<?xml version="1.0" encoding="utf-8"?>
<conversion formatType="PDF" fileType="">
     <inputFiles>
        <file>C:\Examples\Documents\document1.docx</file>
        <file>C:\Examples\Documents\document2.docx</file>        
     </inputFiles>
     <inputFolders>
        <folder>C:\Examples\Documents\New</folder>
        <filter>*.docx</filter>
        <includeSubfolders>false</includeSubfolders>        
     </inputFolders>
     <outputFolder>%MYDOCUMENTS%\AVS4YOU\AVSDocumentConverter</outputFolder>
     <formatSettings>
        <pdf>
            <makeMerge>false</makeMerge>
            <permissions>
                <setPermissions>true</setPermissions>
                <owner>Owner</owner>
                <user>User</user>
                <restrictEditing>true</restrictEditing>
                <restrictPrinting>false</restrictPrinting>
                <restrictCopyingContent>true</restrictCopyingContent>
            </permissions>
        </pdf>
        <images>
            <jpeg>
                <quality>95</quality>
            </jpeg>
            <tiff>
                <compress>false</compress>
            </tiff>
        </images>
        <html>
            <richHtml>
                <addToolbar>false</addToolbar>
            </richHtml>
        </html>
        <txt>
            <encoding>UTF-8</encoding>
        </txt>
        <ebook>
            <makeMerge>false</makeMerge>
            <saveCover>true</saveCover>
            <epub>
                <embeddedFonts>true</embeddedFonts>
            </epub>
        </ebook>
        <watermark>
            <addWatermark>false</addWatermark>
            <text>WATERMARK TEXT</text>
            <font>
                <name>Arial</name>
                <size>96</size>
                <bold>false</bold>
                <italic>false</italic>
                <underline>false</underline>
                <strikeout>false</strikeout>
                <color>0</color>
            </font>
            <align>1</align>
            <opacity>40</opacity>
        </watermark>
     </formatSettings>
     <autostartConversion>true</autostartConversion>
     <minimizeForm>false</minimizeForm>
     <replaceFileAndDir>true</replaceFileAndDir>
     <finalAction>2</finalAction>
     <openOutputFolder>true</openOutputFolder>
</conversion>
  • The <conversion fileFormat=""> tag allows to set the desired output format.

    In the example above, the PDF format is specified, as it allows to enable password protection. For other purposes, you can also convert your documents into DOC, DOCX, Image (JPEG, TIFF, GIF, PNG), HTML (Plain HTML, Rich HTML, MHT), ODT, PTF, TXT, eBook (ePub, FB2, Mobi).

  • The <formatSettings> tag allows to specify some output format parameters.

    E.g. for the PDF format, you can specify if you want to merge input documents into a single PDF file or not, setting the <makeMerge> parameter to true or false correspondingly.

    As we are about to create password-protected documents, we need to use the <permissions> section. It should look something like this:

    <permissions>
        <setPermissions>true</setPermissions>
        <owner>Owner</owner>
        <user>User</user>
        <restrictEditing>true</restrictEditing>
        <restrictPrinting>false</restrictPrinting>
        <restrictCopyingContent>true</restrictCopyingContent>
    </permissions>
    

    The following tags are used in this example:

    • The <setPermissions> tag is set to true, that allows you to enable password protection and (optionally) restrict what can be done with the document.
    • The <owner> tag specifies the owner password that provides you with full access to the file.
    • The <user> tag specifies the user password that allows only those who know it to open the file. This password must differ from the owner password.
    • The <restrictEditing> tag can be set to true so that you can restrict others from editing the file.
    • The <restrictPrinting> tag can be set to true if you want to prevent other users from printing the file. The false value used in the example above means that the document can be printed by a user who knows the correct user password.
    • The <restrictCopyingContent> tag can be set to true in order to disable copying content of the file.
  • The <inputFiles> and <inputFolders> tags allow to set your input files and/or folders location.

    E.g. you can list necessary files one by one using the <inputFiles> parameter or specify paths to folders using the <inputFolders> parameter and filter the folder contents by file extension.

    The *.docx value specified for the <filter> tag in the example above allows to upload DOCX files only. The *.* value allows to upload all the documents stored in the folder. To use files of several specified formats only, set the values separating them with a semicolon: *.doc;*.docx etc.

  • The <outputFolder> tag is used to set a path to the folder fot output files.
  • If necessary, you can also use the <watermark> tag to set parameters for adding a watermark to your documents.
  • The <autostartConversion> tag is used to specify if you want to start the conversion process immediately as the program launches. Set it to false if you just want to launch AVS Document Converter with all the specified parameters without starting the conversion itself.
  • Finally, specify some general parameters like the actions that must be accomplished after conversion etc.

Please do not forget to replace the paths to input files/folders provided in our examples with your own ones. When specifying paths to files and folders using the <file>, <folder> and <outputFolder> tags, you can use environment variables like %PROGRAMFILES%, %MYDOCUMENTS% etc. In the example above we use the %MYDOCUMENTS% variable that specifies the "Documents" / "My Documents" directory of the current user.

For more details on the tags and environment variables used in the AVS Document Converter XML files please refer to our Appendix section. You can also find all the necessary information in the CommandLineKeys.txt file located in the AVS Document Converter installation folder.

[Back to the Top]

Step 4: Start the conversion from the command line

  1. Start the Command Prompt. For example, you can press the Win+R key combination, type cmd and press Enter.
  2. Use the cd command to go to the AVS Document Converter installation directory that contains the application executable file. If you are using a 32-bit version of Windows, the command should look like this:
    cd C:\Program Files\AVS4YOU\AVSDocumentConverter
    

    If you are using a 64-bit version of Windows, run the following command:

    cd C:\Program Files (x86)\AVS4YOU\AVSDocumentConverter
    
    Note!Note: if you forgot where the installation folder is located, you can easily find it in the following way: right-click on the application desktop shortcut and select the Properties option. Copy the path specified in the Start in field and paste it using the Ctrl+V key combination or just right-clicking within the Command Prompt window.
  3. To run the AVS Document Converter in the automatic mode, use the following command:
    AVSDocumentConverter.exe -a "C:\AVSDocumentConverter.xml"
    

    where:

    • AVSDocumentConverter.exe is the converter executable file name.
    • -a is one of the possible commands to run the application in the automatic mode,
    • C:\AVSDocumentConverter.xml is the full path to the XML file you've created. Please note that you need to replace the path to the XML file provided in the command example with your own one before executing the command. The file path must be enclosed in double quotes.

How to protect multiple PDF files with a password at once? Step 4

AVS Document Converter starts with all the conversion parameters specified in the XML file, and the conversion process begins immediately (if the <autostartConversion> parameter is set to true).

How to protect multiple PDF files with a password at once? Step 4

Once the conversion is over, the AVS Document Converter window closes automatically and the assigned output folder with the converted files opens (but you can specify another final actions in the configuration XML).

Note!Note: if you wish to just run the converter from the command line with some files loaded so that you can manually edit them or change some parameters before the conversion, you can either set the <autostartConversion> parameter to false or use the following command in the Command Prompt window:

"C:\Program Files\AVS4YOU\AVSDocumentConverter\AVSDocumentConverter.exe" "C:\Documents\document1.docx" "C:\Documents\document2.docx"

[Back to the Top]

Version: 4.2.2.267Size: 28.92 MBPlatforms: Windows 10, 8.1, 8, 7, XP, 2003, Vista
(no Mac OS/Linux support)
Download
AVS Document Converter

Registration on AVS4YOU is like buying a single product listed on www.AVS4YOU.com and getting all other products from our site as a gift. That means you can install and use ALL OTHER software with the same serial number without additional fees and limitations.
Please note that AVS4YOU programs do not allow you to copy protected material. You may use this software in copying material in which you own the copyright or have obtained permission to copy from the copyright owner.

By using our services, you agree to our use of cookies.