PDF4Java Reference Documentation
com.o2sol.pdf4java.utilities Package / PDFEncryptor Class / encryptFile Method / encryptFile(Stream,Stream,PDFSecurityHandler,boolean) Method
Stream containing the input PDF file.
Stream for storing 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(Stream,Stream,PDFSecurityHandler,boolean) Method
In This Topic
Encrypts the PDF file given in input stream and saves the encrypted file to output stream.
Syntax

    public static void encryptFile(
       Stream input,
       Stream output,
       PDFSecurityHandler securityHandler,
       boolean enableObjectCompression
    )

#### Parameters

input
  Stream containing the input PDF file.
output
  Stream for storing 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.