How to decode PDF multi-filter
Solution 1:
But in the case of multiple filters as shown below, which one should be turned off first?
According to the PDF specification ISO 32000-2:2020, the filters shall be applied in the order in which they occur in that array:
Key | Type | Value |
---|---|---|
Filter | name or array | (Optional) The name, or an array of zero, one or several names, of filter(s) that shall be applied in processing the stream data found between the keywords stream and endstream. Multiple filters shall be specified in the order in which they are to be applied. |
(Table 5 — Entries common to all stream dictionaries)
In case of your example, therefore,
you first have to ASCIIHexDecode the content - i.e. the hex digits in the stream shall be pairwise converted to bytes - and then FlateDecode those bytes.