PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

PDF w/ CCITT image throws in GetValue()
http://forum.pdfsharp.de/viewtopic.php?f=2&t=2355
Page 1 of 1

Author:  andy_t [ Tue Mar 05, 2013 9:53 pm ]
Post subject:  PDF w/ CCITT image throws in GetValue()

I'm working with a PDF scanned image. The image is stored as CCITTFaxDecode. I'm trying to extract the /DecodeParms for the image using GetValue("/DecodeParms"), and get this message:

"Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support.");"

Also the object's Meta parameter is Null

Anyone have a hint????

[Here is the PDF Header]
%PDF-1.4 Sharp Scanned ImagePDF
%Sharp Non-Encryption
3 0 obj
<<
/Type /Page
/Parent 1 0 R
/Resources 4 0 R
/Contents 5 0 R
/MediaBox [0 0 613 790]
>>
endobj
4 0 obj
<<
/ProcSet [/PDF /ImageB]
/XObject << /Img1 6 0 R >>
>>
endobj
5 0 obj
<<
/Length 27
>>
stream
613 0 0 790 0 0 cm
/Img1 Do
endstream
endobj
6 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /Img1
/Filter /CCITTFaxDecode
/DecodeParms << /K -1 /Columns 1704 /Rows 2196 >>
/Width 1704
/Height 2196
/BitsPerComponent 1
/ColorSpace /DeviceGray
/Length 7 0 R
>>
stream

Author:  Thomas Hoevel [ Wed Mar 06, 2013 9:06 am ]
Post subject:  Re: PDF w/ CCITT image throws in GetValue()

andy_t wrote:
Anyone have a hint????
How about trying GetArray("/DecodeParms") or GetDictionary("/DecodeParms")?
There is a list of values, not just a single value so GetValue can't help (but I don't know which function has to be used in this case).

Author:  andy_t [ Wed Mar 06, 2013 3:01 pm ]
Post subject:  Re: PDF w/ CCITT image throws in GetValue()

Yes, GetDictionary("/DecodeParms") returns a PdfDictionary with the elements. Then I had to call GetInteger("/K") ..("/Columns") and ..("/Rows") to get the values.

Thanks for the clarification..... I'm still learning how to use PDFSharp~!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/