Esempio n. 1
0
 /// <summary>
 /// Loads a <see cref="PdfDocument"/> from '<paramref name="count"/>' bytes read from a <paramref name="stream"/>.
 /// <see cref="Close"/> must be called in order to free unmanaged resources.
 /// </summary>
 /// <param name="stream"></param>
 /// <param name="fileRead"></param>
 /// <param name="count">
 /// The number of bytes to read from the <paramref name="stream"/>.
 /// If the value is equal to or smaller than 0, the stream is read to the end.
 /// </param>
 /// <param name="password"></param>
 public PdfDocument(Stream stream, FPDF_FILEREAD fileRead, int count = 0, string password = null)
     : this(Pdfium.FPDF_LoadDocument(stream, fileRead, count, password))
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Loads a <see cref="PdfDocument"/> from the file system.
 /// <see cref="Close"/> must be called in order to free unmanaged resources.
 /// </summary>
 /// <param name="fileName">Filepath of the PDF file to load.</param>
 public PdfDocument(string fileName, string password = null)
     : this(Pdfium.FPDF_LoadDocument(fileName, password))
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Loads a <see cref="PdfDocument"/> from memory.
 /// <see cref="Close"/> must be called in order to free unmanaged resources.
 /// </summary>
 /// <param name="data">Byte array containing the bytes of the PDF document to load.</param>
 /// <param name="index">The index of the first byte to be copied from <paramref name="data"/>.</param>
 /// <param name="count">The number of bytes to copy from <paramref name="data"/> or a negative value to copy all bytes.</param>
 public PdfDocument(byte[] data, int index = 0, int count = -1, string password = null)
     : this(Pdfium.FPDF_LoadDocument(data, index, count, password))
 {
 }