5 Replies Latest reply: Sep 23, 2013 7:29 AM by olafdruemmer RSS

    How to find decoder name from decoded stream?

    Xavier.d@adobe.con

      Hey,

       

      177 0 obj^M<</Length 110 /Filter /FlateDecode >>^Mstream^M

      x<9c>3´Ô30P0^@^Q<86> B^WÂ4^C<91>Fæ 2ÅP¡^P"^@Q^G#Á²^P]0¡ä\^E'O^Eýp r^E}^O

      ^E}§^@g^EC^E}O_<85><92>¢ÒT^E}^W<85>hC^E<83>X^O^W^E^F>Âð^A^X~à+<90>©°±ÿ !ÿ<81>ÿ<80>«§B ^@ßÆ"Ø^Mendstream^Mendobj

       

      I have decoded the above stream by using the FlateDecode and I can get the below result.

       

      19.00 0.00 1.00 -0.00 16.00 27.00 d1 q 16.000 0.000 0.000 27.000 1.000 0.000 cm BI /W 16 /H 27 /BPC 1 /IM true /D [1 0]

      ID                   ¢ ¢ ¢ ￰ p x<?￸ ￰ ￀EI Q

       

      Still the Image Data [ID] is encoded.  I have to decode this Image data by using the corresponding decoder to get the exact value.

      But I'm confused, how to find the decoder name? Which decoder needs to be used for decode this ID [Image Data]?

      Can someone help me to find the decoder for Image Data [ID].

       

      Thanks,

      Xavier

        • 1. Re: How to find decoder name from decoded stream?
          olafdruemmer Community Member

          What makes you assume it is encoded? It is just bits, as you are dealing with an imagemask and htis with a bit depth of 1. Also, based on the D entry you know when bits are filled and when not.

           

          Olaf

          • 2. Re: How to find decoder name from decoded stream?
            Xavier.d@adobe.con

            Thanks Olaf for reply this thread.

             

            The object which I mentioned is available in the below difference list.

             

            0 obj^M<<^M/Type/Encoding^M/Differences [^M 0/C0/C1/C2/C3/C4/C5/C6/C7/C8/C9/Ca/Cb/Cc/Cd/Ce/Cf/C10/C11/C12/C13/C14/C15/C16/C17/C18/C19 /C1a/C1b/C1c^M/C1d/C1e/C1f/C20/C21/C22/C23/C24/C25/C26/C27/C28/C29/C2a/C2b/C2c/C2d/C2e/C2f /C30/C31/C32/C33 53/C35/C36^M/C37 58/C3a 60/C3c/C3d/C3e/C3f/C40/C41/C42/C43/C44/C45/C46 72/C48/C49/C4a 76/C4c/C4d/C4e 80/C50^M]^M>>^Mendobj

             

            I assumed the C0 ... C50 are characters for the font type /C0E00M7K2.  This a type3 font. So after my flate decode I got the above detailed result including BPC and /D array.  How to find the exact character from the ID?  I refered somewhat from the Pdf Reference 1.7, there they mentioned like the ID is in encoded format.  That's what I guess this may be encoded.  Is there a way to find the exact ascii character from the below result?

             

             

            19.00 0.00 1.00 -0.00 16.00 27.00 d1 q 16.000 0.000 0.000 27.000 1.000 0.000 cm BI /W 16 /H 27 /BPC 1 /IM true /D [1 0]

            ID                   ¢ ¢ ¢ ￰ p x<?￸ ￰ ￀EI Q

             

            Thanks in advance.

            Xavier

            • 3. Re: How to find decoder name from decoded stream?
              olafdruemmer Community Member

              Youy are mixing up encoding of a Typ3 font (howe to go from character names to gyph defintions) with encoding for an image stream (or more generically,  a filtered stream). Your image data is noit compressed, no encoding applies. Your Type3 font's encoding has nothing to do with the image encoding. A character name in a Type3 font simply points to an object that defines the appearance of the respecive glyph. Your glyph seems to contain a mask - not uncommon for bitmap fonts. None of the font types that can be used in a PDF support bitmap fonts, except Type3 fonts.

               

              Aaah - and ID does not stand for "identity" but rather for "image data". Please read the inline image section in the PDF standard some more....

               

              Olaf

              • 4. Re: How to find decoder name from decoded stream?
                Xavier.d@adobe.con

                The inline image object entries are having filter /F [Pdf Reference book 1.7, Table 93 & 94].  But I didn't find any filters here,

                 

                19.00 0.00 1.00 -0.00 16.00 27.00 d1 q 16.000 0.000 0.000 27.000 1.000 0.000 cm BI /W 16 /H 27 /BPC 1 /IM true /D [1 0]

                ID                   ¢ ¢ ¢ ￰ p x<?￸ ￰ ￀EI Q.

                 

                So, Do you mean there is no filter applied for this stream?  Or any default filters are there?

                 

                Thanks,

                Xavier

                • 5. Re: How to find decoder name from decoded stream?
                  olafdruemmer Community Member

                  If there is no filter entry, then no filter has been applied - you have raw data for the inline image.

                   

                  For small bitmap inline images it often does not make a lot of sense to apply compression to the inline image data  (especially when the content or appearance stream is compressed anyway, albeittypically just with Flate).

                   

                   

                  Olaf