←Select platform

PDFDocument Constructor(Stream,string)

Summary
Initializes a new PDFDocument from the specified stream containing a PDF file and (optional) password.
Syntax
C#
C++/CLI
Java
Python
public PDFDocument( 
   Stream stream, 
   string password 
) 
public: 
PDFDocument(  
   Stream^ stream, 
   String^ password 
) 

Parameters

stream
The stream containing an existing PDF file. This cannot be null and must support reading and seeking.

password
The password to use if stream contains an encrypted PDF file.

public PDFDocument( 
   ILeadStream stream, 
   java.lang.String password 
); 
__init__(self,stream,password) # Overloaded constructor 
Remarks

The PDFDocument class encapsulates a PDF document on disk or stream and allows you to read the pages, objects and images from the document.

stream must be kept alive as long as this PDFDocument object is alive and should not be disposed of. The stream can be safely disposed of when disposing this PDFDocument.

stream must contain the data of a valid PDF file. If the PDF file is encrypted, then password is used to try to decrypt the file. If the password value is not correct, an exception will be thrown. Another way of loading PDF documents is to use the PDFDocument(Stream stream) constructor. This constructor does not work on encrypted PDF files. Use the PDFFile.IsEncrypted to determine whether a PDF file is encrypted.

This method will initialize the members of PDFDocument as follows:

Use PDFDocument Constructor(String,String) to create a PDF document from a file on disk.

Requirements

Target Platforms

Help Version 22.0.2023.7.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.