Namespace: PdfSharp.Pdf.IO
Represents the functionality for reading PDF documents.
public static class PdfReader
Inheritance Object → PdfReader
Determines whether the file specified by its path is a PDF file by inspecting the first eight bytes of the data. If the file header has the form «%PDF-x.y» the function returns the version number as integer (e.g. 14 for PDF 1.4). If the file header is invalid or inaccessible for any reason, 0 is returned. The function never throws an exception.
public static int TestPdfFile(string path)
path
String
Determines whether the specified stream is a PDF file by inspecting the first eight bytes of the data. If the data begins with «%PDF-x.y» the function returns the version number as integer (e.g. 14 for PDF 1.4). If the data is invalid or inaccessible for any reason, 0 is returned. The function never throws an exception. This method expects the stream position to point to the start of the file data to be checked.
public static int TestPdfFile(Stream stream)
stream
Stream
Determines whether the specified data is a PDF file by inspecting the first eight bytes of the data. If the data begins with «%PDF-x.y» the function returns the version number as integer (e.g. 14 for PDF 1.4). If the data is invalid or inaccessible for any reason, 0 is returned. The function never throws an exception.
public static int TestPdfFile(Byte[] data)
data
Byte[]
Implements scanning the PDF file version.
internal static int GetPdfFileVersion(Byte[] bytes)
bytes
Byte[]
Opens an existing PDF document.
public static PdfDocument Open(string path, PdfDocumentOpenMode openMode)
path
String
openMode
PdfDocumentOpenMode
Opens an existing PDF document.
public static PdfDocument Open(string path, PdfDocumentOpenMode openMode, PdfPasswordProvider provider)
path
String
openMode
PdfDocumentOpenMode
provider
PdfPasswordProvider
Opens an existing PDF document.
public static PdfDocument Open(string path, string password, PdfDocumentOpenMode openMode)
path
String
password
String
openMode
PdfDocumentOpenMode
Opens an existing PDF document.
public static PdfDocument Open(string path, string password, PdfDocumentOpenMode openMode, PdfPasswordProvider provider)
path
String
password
String
openMode
PdfDocumentOpenMode
provider
PdfPasswordProvider
Opens an existing PDF document.
public static PdfDocument Open(string path)
path
String
Opens an existing PDF document.
public static PdfDocument Open(string path, string password)
path
String
password
String
Opens an existing PDF document.
public static PdfDocument Open(Stream stream, PdfDocumentOpenMode openMode)
stream
Stream
openMode
PdfDocumentOpenMode
Opens an existing PDF document.
public static PdfDocument Open(Stream stream, PdfDocumentOpenMode openMode, PdfPasswordProvider passwordProvider)
stream
Stream
openMode
PdfDocumentOpenMode
passwordProvider
PdfPasswordProvider
Opens an existing PDF document.
public static PdfDocument Open(Stream stream, string password, PdfDocumentOpenMode openMode)
stream
Stream
password
String
openMode
PdfDocumentOpenMode
Opens an existing PDF document.
public static PdfDocument Open(Stream stream, string password, PdfDocumentOpenMode openMode, PdfPasswordProvider passwordProvider)
stream
Stream
password
String
openMode
PdfDocumentOpenMode
passwordProvider
PdfPasswordProvider
Opens an existing PDF document.
public static PdfDocument Open(Stream stream)
stream
Stream