GNOME Bugzilla – Bug 591136
Cannot handle iref streams
Last modified: 2018-07-16 10:12:20 UTC
Please describe the problem: Ebook from http://aspnetmvcbook.s3.amazonaws.com/aspnetmvc-nerdinner_v1.pdf can't be opened due to PDFsharp limitations (see stacktrace) Steps to reproduce: 1. download ebook chapter from http://aspnetmvcbook.s3.amazonaws.com/aspnetmvc-nerdinner_v1.pdf 2. try open pdf with pdfmod Actual results: "Error loading document" dialog is shown Expected results: opened document Does this happen every time? yes Other information: stacktrace: [Debug 12:10:58.704] Starting PdfMod [Warn 12:11:16.787] Caught an exception - Cannot handle iref streams. The current implementation of PDFsharp cannot handle this PDF feature introduced with Acrobat 6. (in `PdfSharp') at PdfSharp.Pdf.IO.Parser.ReadXRefTableAndTrailer (PdfSharp.Pdf.PdfReferenceTable xrefTable) [0x00000] at PdfSharp.Pdf.IO.Parser.ReadTrailer () [0x00000] at PdfSharp.Pdf.IO.PdfReader.Open (System.IO.Stream stream, System.String password, PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider passwordProvider) [0x00000] at PdfSharp.Pdf.IO.PdfReader.Open (System.String path, System.String password, PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider provider) [0x00000] at PdfSharp.Pdf.IO.PdfReader.Open (System.String path, PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider provider) [0x00000] at PdfMod.Document.Load (System.String uri, PdfSharp.Pdf.IO.PdfPasswordProvider passwordProvider, Boolean isAlreadyTmp) [0x00000] at PdfMod.PdfMod+<LoadPath>c__AnonStorey9.<>m__19 () [0x00000] [Error 12:11:16.788] Error Loading Document - There was an error loading /home/tomek/Dokumenty/books/aspnetmvc.pdf
Filed upstream at http://pdfsharp.codeplex.com/WorkItem/View.aspx?WorkItemId=8466
*** Bug 620833 has been marked as a duplicate of this bug. ***
*** Bug 634457 has been marked as a duplicate of this bug. ***
*** Bug 648489 has been marked as a duplicate of this bug. ***
*** Bug 667442 has been marked as a duplicate of this bug. ***
I believe this is now supported in the beta version of pdfsharp, so pdfmod could be updated to use that.
I'm having pretty good results with the beta version. An alternative option is to borrow the CompatiblePdfReader function which has been patched into pdfsharp at http://sourceforge.net/projects/pdfmerge - it uses an old iText.
Created attachment 330525 [details] pdf generated by pdfmod with faulty bookmarks
Created attachment 330526 [details] original pdf before without bookmarks
Oops - sorry, posted those attachments to the wrong ticket!
It looks like this has been broken for about 6 years now. Has there been any progress made on a patch?
pdfmod is not under active development anymore and had its last code changes in 2011. Its codebase has been archived: https://gitlab.gnome.org/Archive/pdfmod/commits/master Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.