Skip to main content
Participant
February 12, 2018
Question

Type 3 font's parsing pdf to postscript

  • February 12, 2018
  • 1 reply
  • 464 views

I have an input pdf file which is using type3 fonts. The glyph definitions contain inline images and flate decode filter applied on them.

My moto is parse the glyphs to postscript. Does i need to remove the filter from the data manually or just take the binary data as is to postscript. I have read postscript support flate decode filters.Here is the sample glyph definition:

32 0 obj

  <<

  /Length 342

  >>

  stream

  37 0 4 -52 33 -1 d1

  0.01 0 0 0.01 0 0 concat

  gsave 2900 0 0 -5100 400 -100 concat

  BI

  /IM true

  /W 29

  /H 51

  /BPC 1

  /D[1

  0]

  /F/Fl

  /DP<</Predictor 15

  /Columns 29>>

  ID xœ=Ì¡

  Â`ÅñÿeÂLθ n`0>Ù`ñ

  f[¦DŒF_ÁhC1ì%Ä)¶o.¢Ÿ"†ßá†s®àì]^ÏŠÅS³tFËÂÚ3sç'Æi èÐÇ:j‹¹¨åìOTÿ ª•ÉÙÕÅŸ¨‡¹Ó$°ÆÎšWèÁ!¯Cê

  ÷0&f µtðV ©Ë÷iôíØªÄ~Ø•Œöí&´« +ro#Ê‚ûÏÅùlßG'

  EI gRestore

  endstream

  endobj

Here is what i am trying in postscript

/g21 {

37 0 4 -52 33 -1 setcachedevice

gsave

[0.01 0 0 0.01 0 0] concat

gsave

[2900 0 0 -5100 400 -100] concat

[ xœ…ѱNÃ0à3©p'l` ¢abä*‰'@‚W`KP¡00öQ`d@ ¨CWž€u`‰štj4Ü]@ /ù¤œíÿ| ÂìÊüå7úЉV'‚ª¦zò¡9à*´º

m1Õ`ñ—íü‹‡½Gù@ãÝAVxc¥Ž®"6oFܬJHÃB3(æod¾…xFP†o$!v±Ã»·0—gØY÷J$û„`´#zÊ

Oí¼œÑ¸é`Ê}ü…ñ.Z¯›cF4\¡*O¤ÑPÒYòî¦/éG‘qÑç¼2>öq<Üœ<

B˜5‚²¢ºÎ/èqUTUàoÓ9͔Π܉ä²z ‡S×ÛÙC(PA²š7èT¾ŽCGÈRaLéåksnˆÃ0z<zø:ž=

]

0

<<

  /ImageType 1

  /Width 29

  /Height 51

  /ImageMatrix [29 0 0 -51 0 51]

  /BitsPerComponent 1

  /Decode [1 0]

  /DataSource { 2 copy get exch 1 add exch }

  <</Predictor 15

  /Columns 29

  >>

  /FlateDecode filter

>>

imagemask

pop pop

gRestore

gRestore

} def

The only problem i think is in representing data of image. any suggestions how can i parse it correctly.

This topic has been closed for replies.

1 reply

Participant
February 20, 2018