PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 01, 2024 6:19 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Mar 03, 2013 5:49 pm 
Offline

Joined: Sun Mar 03, 2013 5:32 pm
Posts: 6
First, I'm new to PDFsharp, so sorry is this is in the wrong place. I did a broad search and didn't find anthing on this topic. I'm running the latest version of the code, downloaded 02Mar2013.

[Issue]: I have a PDFv1.3 file with embedded JPEG images. GetName() is throwing when it tries to parse /Filter key.(PDF header below) Any help would be greatly apprciated!

throw new InvalidCastException("GetName: Object is not a name.");

%PDF-1.3
% âãÏÓ
3 0 obj
<< /Type /XObject
/Subtype /Image
/Width 2144
/Height 2848
/BitsPerComponent 8
/Length 629552
/ColorSpace /DeviceRGB
/Filter [/FlateDecode /DCTDecode]
>>
stream


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 3:32 am 
Offline

Joined: Sun Mar 03, 2013 5:32 pm
Posts: 6
A refined search turned up this thread: viewtopic.php?f=2&t=1053&p=2814&hilit=%2FFilter+%5B%2FFlateDecode+%2FDCTDecode%5D#p2814

I guess the answer is: "Not supported...." Back to square one. :cry: It also apears that GetImage() doesn't handle /FlateDecode, so not sure what I'm going to do......


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 10:23 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
andy_t wrote:
I guess the answer is: "Not supported...."
The answer is "left as an exercise to the reader". The sample is only meant to get you started.

With "/Filter [/FlateDecode /DCTDecode]" you only have to call the decoder for "/FlateDecode" to get the JPEG file.

See also:
viewtopic.php?p=5635#p5635

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 05, 2013 9:35 pm 
Offline

Joined: Sun Mar 03, 2013 5:32 pm
Posts: 6
Thanks Thomas.... We always want life to be simple. With the other thread you provided, and a bit of work on my part, I was able to isolate the internally compressed jpeg stream, decompress it, and save the image.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 53 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group