Opens an existing password-protected document.

Namespace: TallComponents.PDF
Assembly: TallComponents.PDF.Controls.WinForms (in TallComponents.PDF.Controls.WinForms.dll) Version: 2.0.46.0

Syntax

C#
public Document(
	BinaryReader reader,
	string password
)
Visual Basic
Public Sub New ( _
	reader As BinaryReader, _
	password As String _
)

Parameters

reader
Type: System.IO..::..BinaryReader
The reader from which the document is read.
password
Type: System..::..String
Password that is required to open this document.

Remarks

This method gives you full control how the document is read. It requires that the binary reader remains open during the lifetime of the document.

When using the BinaryReader we will read information you need on demand only (note: you should not close/dispose the stream and/or binaryreader during the hole session you need the document, or pages, bookmarks, info extracted from it.), so when you hit page 10 only, we skip (internally we seek to the correct position) all other pages and return you page 10. When you after that request say page 5 we seek back and read that page. In this mode we do not read more information than needed, we do not read the whole document in memory either.

Using is very simple, sample code: FileStream fileStream = new FileStream( @"in.pdf", FileMode.Open, FileAccess.Read ); BinaryReader reader = new BinaryReader( fileStream ); Document source = new Document( reader, "MyPassword" );

See Also