Filed under C# , work
[July 09 2012 Update] As some people have emailed and commented, another option to work around this solution is to plugin iTextSharp and use that for opening PDFs older than ver 5. The workaround can be found over on the PDFSharp forums http://forum.pdfsharp.net/viewtopic.php?f=2&t=693#p5855. I decided against this option myself as it would have required me to install and setup another third party library which I didn't want to do.
I use PDFSharp with my ,net projects as a great way to produce invoices for our online stores. Some of our customers supply us with blank PDFs and we use these as templates when generating a new invoice.
I was given a PDF recently that was encoded using Adobe Acrobat 9. Normally we don't have any issues but this file was throwing the following error any time I wanted to open it:
cannot handle iref streams. the current implementation of pdfsharp cannot handle this pdf feature introduced with acrobat 6
It turns out that the encoding a PDF form above ver 5 gives PDFSharp a bit of a headache. The solution for us was to simply re-save the file with Adobe Reader v5 format. We were able to do this using Adobe Acrobat or Photoshop.