Color Depth 1 is not supported

I am using iTextSharp version 5.5.2.0 and when I try to download the attached sample pdf 058780-02.pdf I get an exception in ImageRenderInfo.GetImage (), the method "PdfImageObject" does not return with the message "Color depth 1 is not supported". Any suggestions? Thanks, Abedellatif

+5
source share
1 answer

i fixed it, changed the source code of iTextSharp PdfImageObject class FindColorspace on line 222 add

 if (PdfName.CALGRAY.Equals(tyca) || PdfName.DEVICEGRAY.Equals(tyca)) { stride = (width * bpc + 7) / 8; pngColorType = 0; } 
+1
source

Source: https://habr.com/ru/post/1257604/


All Articles