[NTG-pdftex] \pdffiledump

Hans Hagen pragma at wxs.nl
Mon Jul 4 15:48:47 CEST 2005


Heiko Oberdiek wrote:

> \pdffiledump length 20 {abc.bmp}
> 
> Reads the first twenty bytes of abc.bmp in binary mode and
> returns them as hex string.
> 
> Uses: a lot, eg. inspecting the file header to get
> size information of bitmap files (eg. for latex/dvips).
> Or it could be used to read ucs2/4 files, recode them
> and reading (\scantokens, \pdfunescapehex) them as utf-8.

often one needs more trickery to get a size due to the fact that many bitmap 
formats are linked lists of tagged records; i suppose that reading in a 400K 
file has some mem penalty -)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-pdftex mailing list