Forum > General

[Solved] How to decode streams of type FlateDecode?

(1/2) > >>

loaded:
Hi All,
There are streams encoded as FlateDecode in a pdf file I have. Is there a method to solve these flows in the simplest way?
I would be glad if you share your experience and suggestions. Respects.

KodeZwerg:
Use any Pdf library to do, would be fastest solution. With ZLib you should also be able to "unpack" such stream.

loaded:
Thank you so much KodeZwerg for the answer.
I use ghostscript for my pdf processing. It works great.
But I wanted to do something myself.
Yes Zlib might be the solution, I'll try that.

marcov:
 seems so: https://gist.github.com/averagesecurityguy/ba8d9ed3c59c1deffbd1390dafa5a3c2

note the   


--- Code: PHP  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  print(zlib.decompress(s))

loaded:
Thank you so much marcov for the answer.

--- Quote from: marcov on September 27, 2022, 11:26:15 am --- seems so: https://gist.github.com/averagesecurityguy/ba8d9ed3c59c1deffbd1390dafa5a3c2

--- End quote ---

https://forum.lazarus.freepascal.org/index.php/topic,33009.msg213157.html#msg213157
With the help of your suggestion and the codes in the link, my problem was solved.

But now a problem has arisen.
Pdf files contain both text and stream objects.
What's the easiest way to extract these stream objects from texts?
The python code in the link you posted can do this very simply.
Is this possible in Lazarus?

Navigation

[0] Message Index

[#] Next page

Go to full version