0

Getting the following exception when trying to open a PDF document with PdfSharp.PdfReader

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "PdfSharp.Resources.Messages.resources" was correctly embedded or linked into assembly "PdfSharp-gdi" at compile time, or that all the satellite assemblies required are loadable and fully signed.

pdfDocument1 = PdfReader.Open(stream1, PdfDocumentOpenMode.Import);
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
LIvanov
  • 1,126
  • 12
  • 30

1 Answers1

0

Most likely an exception occurs while opening the PDF file. The code that tries to load the display text for the exception causes another exception and therefore you cannot see what is wrong with the PDF file.

I assume you are using an old version of PDFsharp. The current version 1.50.4845-RC2a should show the appropriate error message.

  • Ok, that changed the exception as you suggested. Now I am getting: `Unhandled Exception: PdfSharp.Pdf.IO.PdfReaderException: The PDF document is protected with an encryption not supported by PDFsharp.` – LIvanov Apr 23 '18 at 19:09