[Dev-luatex] draftmode bugs

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sat Dec 25 20:07:48 CET 2010


Hello,

Michael Niedermair reported two bugs in the mailing list TEX-D-L.
He used lualatex, but I could reduce it to
  luatex -ini -draftmode

Used version:
  This is LuaTeX, Version beta-0.65.0-2010121316  (INITEX)

1. draftmode creates output file with zero bytes:

\catcode`\{=1
\catcode`\}=2
\directlua{tex.enableprimitives('',{'pdfoutput'})}
\pdfoutput=1
\shipout\hbox{}
\csname @@end\endcsname\end

Result:
  LuaTeX warning: \pdfdraftmode enabled, not changing output pdf
  Transcript written on test.log.
But test.pdf is created with zero bytes.
(It does not matter if a previous test.pdf exists, it will be
overwritten.)

2. Image inclusion fails in draft mode:

\catcode`\{=1
\catcode`\}=2
\directlua{tex.enableprimitives('',%
  {'pdfoutput','pdfximage','pdfrefximage','pdflastximage'})%
}
\pdfoutput=1
\pdfximage{s1.png}\pdfrefximage\pdflastximage
\csname @@end\endcsname\end

! LuaTeX error (setup): \pdfdraftmode cannot be changed after data is
written to the PDF file.

Yours sincerely
  Heiko Oberdiek


More information about the dev-luatex mailing list