using var inputStream = new FileStream(pdfFilePath, FileMode.Open, FileAccess.Read);
var image = Conversion.ToImage(inputStream, password, page: 0);
the code fails with the an Exception PDFtoImage.PdfiumViewer.PdfException: 'Password required or incorrect password'
at line 30 in file PDFtoImage\PdfiumViewer\PdfFile as after call to NativeMethods.FPDF_LoadCustomDocument in line 28
var document = NativeMethods.FPDF_LoadCustomDocument(stream, password, _id);
if (document == IntPtr.Zero)
throw new PdfException((PdfError)NativeMethods.FPDF_GetLastError());
*Attached a PDF file with password to test. Please use password 6BA065200 to test
09 September 15 th July PW 6BA065200.pdf While making a call to ToImage method in Conversion with the correct password as shown below
using var inputStream = new FileStream(pdfFilePath, FileMode.Open, FileAccess.Read); var image = Conversion.ToImage(inputStream, password, page: 0);
the code fails with the an Exception PDFtoImage.PdfiumViewer.PdfException: 'Password required or incorrect password'
at line 30 in file PDFtoImage\PdfiumViewer\PdfFile as after call to NativeMethods.FPDF_LoadCustomDocument in line 28
var document = NativeMethods.FPDF_LoadCustomDocument(stream, password, _id); if (document == IntPtr.Zero) throw new PdfException((PdfError)NativeMethods.FPDF_GetLastError());
*Attached a PDF file with password to test. Please use password 6BA065200 to test