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?
PDFsharp 1.50 beta版新增了对IRef流的支持,如果您无法读取文件,请提交以进行检查。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.