PDF4Java Reference Documentation
com.o2sol.pdf4java.utilities Package / PDFEncryptor Class / encryptFile Method / encryptFile(String,String,PDFSecurityHandler,boolean) Method
Path to the input PDF file.
Path to the encrypted PDF file.
The security handler used for encryption.
If true then the internal structure of the output PDF file is compressed.
Collapse All Expand All
In This Topic

encryptFile(String,String,PDFSecurityHandler,boolean) Method
In This Topic
Encrypts the input PDF file and saves the encrypted file to output path.
Syntax

    public static void encryptFile(
       java.lang.String inputFileName,
       java.lang.String outputFileName,
       PDFSecurityHandler securityHandler,
       boolean enableObjectCompression
    )

#### Parameters

inputFileName
  Path to the input PDF file.
outputFileName
  Path to the encrypted PDF file.
securityHandler
  The security handler used for encryption.
enableObjectCompression
  If true then the internal structure of the output PDF file is compressed.

See Also

#### Reference

PDFEncryptor Class
PDFEncryptor Members
Overload List

© 2025 O2 Solutions All Rights Reserved.

Send comments on this topic.