[pdftex] Re: redirecting tex dvi output

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Tue Jan 15 00:02:22 CET 2002


lloyd dalton:
> Heiko Oberdiek wrote:
> 
> >pdfTeX does not write the PDF file byte after byte,
> >sometimes it goes back and changes some bytes
> >(length of streams).
> 
> Thanks, I didn't know that.  That basically rules out
> any piping.  It's a shame TeX behaves that way (I
> assume it's because of TeX, and not just pdftex). 
> There must have been some good reason for coding it
> that way, since it seems to go against intuition.

tex does it because it predates the "intuition" that there's always
enough memory to hold the entirety of a file.  tex needs to patch
links through the dvi file and the like; it probably could be recoded
to avoid that nowadays.

pdftex does it because it really is daft to assume that you can hold
the whole of an arbitrary media stream in memory while you analyse it,
write the stream's header and then dump it out.  you could avoid the
requirement by giving pdftex some sort of os/360-like job control
beforehand, that said "no media streams here bigger than 100kbytes"
(or whatever): with that sort of information, pdftex could be written
to decide on the fly that it could buffer entire media streams, and
hence run the output to pipe.

quite likely, thanh never met os/360 job control language, so the idea
never occurred to him.  he's a lucky man.



More information about the pdftex mailing list