"Unexpected color space /R11" while parsing a PDF file with text and image
System.ArgumentException was unhandled by user code Message=Unexpected color space /R11 Source=itextsharp StackTrace: at iTextSharp.text.pdf.parser.InlineImageUtils.GetComponentsPerPixel(PdfName colorSpaceName) at iTextSharp.text.pdf.parser.InlineImageUtils.ComputeBytesPerRow(PdfDictionary imageDictionary) at iTextSharp.text.pdf.parser.InlineImageUtils.ParseUnfilteredSamples(PdfDictionary imageDictionary, PdfContentParser ps) at iTextSharp.text.pdf.parser.InlineImageUtils.ParseInlineImageSamples(PdfDictionary imageDictionary, PdfContentParser ps) at iTextSharp.text.pdf.parser.InlineImageUtils.ParseInlineImage(PdfContentParser ps) at iTextSharp.text.pdf.parser.PdfContentStreamProcessor.ProcessContent(Byte[] contentBytes, PdfDictionary resources) at iTextSharp.text.pdf.parser.PdfReaderContentParser.ProcessContent[E](Int32 pageNumber, E renderListener) at iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(PdfReader reader, Int32 pageNumber, ITextExtractionStrategy strategy) at iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(PdfReader reader, Int32 pageNumber) at PDF_PdfToText.extractText(String src, String dest) in d:\QC\Backup\NRK\Current\QConform nrk - 2010\PDF\PdfToText.aspx.cs:line 29 at PDF_PdfToText.Page_Load(Object sender, EventArgs e) in d:\QC\B开发者_如何学运维ackup\NRK\Current\QConform nrk - 2010\PDF\PdfToText.aspx.cs:line 17 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException:
iText's inline image parser has undergone some work recently. If you're not using 5.0.5, you might be missing a relevant bug fix.
The whole .pdf.parser package is still under development unfortunately. OTOH, if you do have the latest-n-greatest, and are still getting this exception, you've got an iText[sharp] bug. Head on over to the itext-questions mailing list and post your stack trace along with the PDF that causes it if at all possible. We'll take care of it.
Alternatively, you can report the bug via the sourceforge tracker. Attached files there aren't Broadcast To The World, so you might be more comfortable with that.
精彩评论