I want to read the XMP metadata from PDF documents. I tried to read the data with PDFsharp (http://www.pdfsharp.net/). Most of time it worked well, but in some cases I get this exception:
Unhandled Exception: PdfSharp.Pdf.IO.PdfReaderException: Cannot handle iref streams. The current implementation of PDFsharp cannot handle this PDF feature introduced with Acrobat 6.
I read somewhere that this does not happen in the new version. So I downloaded PdfSharp 1.50.3638-beta (https://www.nuget.org/packages/PdfSharp/1.50.3638-beta).
And yes, now I have no exception. But my new problem is that the function PdfReader.open does not work on some documents. This means that the program never leaves the function.
In some forums I have read that it could be caused by large documents with many images. So I tried to read only the information of the document:
PdfDocument pd = PdfReader.Open(s, PdfDocumentOpenMode.InformationOnly);
But it still doesn't work. Some ideas how I can read the metadata?