i found a solution for my problem.
First i uncompress the file with this method i found in the internet:
Code:
static byte[] FlateDecode(byte[] inp, bool strict)
{
MemoryStream stream = new MemoryStream(inp);
InflaterInputStream zip = new InflaterInputStream(stream);
MemoryStream outp = new MemoryStream();
byte[] b = new byte[strict ? 4092 : 1];
try
{
int n;
while ((n = zip.Read(b, 0, b.Length)) > 0)
{
outp.Write(b, 0, n);
}
zip.Close();
outp.Close();
return outp.ToArray();
}
catch (Exception ex)
{
if (strict)
return null;
return outp.ToArray();
}
}
after that i take the result of this method and call my normal method for decode jpg-image:
Code:
static void ExportJpegImage(PdfDictionary image, string outputFileName)
{
// Fortunately JPEG has native support in PDF and exporting an image is just writing the stream to a file.
byte[] stream = image.Stream.Value;
FileStream fs = new FileStream(outputFileName, FileMode.Create, FileAccess.Write);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(stream);
bw.Close();
}
works perfect.
Thanks again. Without your help i wouldn't be able to solve this issue. Maybe in the future i will try to test your other hints, too.