Can you see what I mean. The Decode function requires a pointer argument. I have to provide it with a PdfDictionary so getting the Decode Parms directly is of no use in this case. dict->HasKey("Columns") and dict->HasKey("Predictor") both indicate true, so when I load the dictionary it is definitely seeing those parms. I can't seem to decode a stream with parms using this function so I'm not sure what is going wrong. If I use this very same code (without parms) on other streams, it decompresses them fine. When I need to use Parms it doesn't decompress the stream. Just outputs jumble. That's all I am trying to do, just using the Decode Function from PdfFilter.
From: abdom...@hotmail.com To: z...@litepdf.cz; podofo-users@lists.sourceforge.net Date: Tue, 19 Aug 2014 17:11:23 +0930 Subject: Re: [Podofo-users] DecodeParms, how to use? Hi Thanks very much for the response. I suppose then my question is with regards to the function below. PdfFilter->Decode (const char *pInBuffer, pdf_long lInLen, char **ppOutBuffer, pdf_long *plOutLen, const PdfDictionary *pDecodeParms) const If I have to do this every time I want to decode a stream, what is the const PdfDictionary *pDecodeParms what would go here if there is a sub_Dictionary? It is certainly easy enough to get the individual values, but from the explanation in the documentation it says the below so I am assuming a complete dictionary must go here.Should it only be the Sub_Dictionary though? In page 175 of the PDF Version of the PODOFO documentation. 'pDictionary pointer to a dictionary that might contain additional parameters fordecoding the stream. CreateDecodeStream will look for a key named DecodeParmsin this dictionary and pass the information found in this dictionaryto the filters.' > From: z...@litepdf.cz > To: podofo-users@lists.sourceforge.net > Date: Tue, 19 Aug 2014 09:02:51 +0200 > Subject: Re: [Podofo-users] DecodeParms, how to use? > > On Tue, 2014-08-19 at 13:17 +0930, Domonic Tom wrote: > > ... > > > > <</DecodeParms<</Columns 4/Predictor > > 12>>/Filter/FlateDecode/ID[<6647557224A6C102A60F6D82BB22C18D><AA383B5CF85B7F4BACB9D502B93343E9>]/Index[10 > > > > 20]/Info 9 0 R/Length 64/Prev 23381/Root 11 0 R/Size > > 30/Type/XRef/W[1 2 1]>> > > > > If I know which object this is and extract the dictionary then I > > can't see why it won't work. > > Hi, > I do not think I can help you much here, also because I'm unsure what > you are trying to do, but maybe this will help a little bit: > > Once you have a PdfDictionary, you can get its keys (and values) by: > if (dict->HasKey("Columns")) > columns = dict->GetKey("Columns"); > > See the base/PdfDictionary.h for more GetKey...() variants. > > If yours 'dict' points to: > <</DecodeParms<</Columns 4/Predictor 12>>...>> > then the way to get into the inner/sub-dictionary might be: > columns = dict->GetKey("DecodeParams")->GetDictionary().GetKey("Columns"); > Some safety checks like HasKey() and IsDictionary() will make your > code more error proof. > > > PdfDictionary *dict = new PdfDictionary; > > *dict = obj->GetDictionary(); > > > > The above construction is incorrect by many means. It might be done > either directly, like in the snippets I wrote above (not assigning to a > variable) or by: > const PdfDictionary &dict = obj->GetDictionary(); > if (dict.HasKey(...)) ... > > Hope it helps, > zyx > > > -- > http://www.litePDF.cz i...@litepdf.cz > > > ------------------------------------------------------------------------------ > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users ------------------------------------------------------------------------------ _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users
------------------------------------------------------------------------------
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users