[tex-live] dvipdfmx: Two (related) special queries

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jul 3 10:05:38 CEST 2017


Hello all,

I'm looking at reproducing some effects achievable using pdfTeX in
direct PDF output mode when in DVI mode, specifically when targetting
dvipdfmx. Normally this is relatively simple as specials are used
directly by a 'TeX-aware' tool.

The first issue is the equivalent of "\pdfliteral direct{...}". That
should be \special{pdf:literal direct ...}/\special{pdf:code ...}.
However, if one tries to do that to put a comment in the PDF stream (see
below) it fails. For example, with pdfTeX we can do

    \pdfcompresslevel=0 %
    \begin{document}
    Hello
    \makeatletter
    \pdfliteral direct{\@percentchar HELLO}
    \end{document}

and get in the PDF stream

    stream
    BT
    /F8 9.9626 Tf 148.712 707.125 Td [(Hello)]TJ
    %HELLO
     154.421 -567.87 Td [(1)]TJ
    ET

but trying the dvipdfmx equivalent

    \documentclass{article}
    \begin{document}
    Hello
    \makeatletter
    \special{pdf:literal direct \@percentchar HELLO}
    \end{document}

nothing happens. I must be missing something obvious!

The second query is about the compress level. I can set that at the
dvipdfmx level using the -z0 switch. However, I'm not entirely clear if
that is the same as applying

    \pdfcompresslevel=0
    \pdfobjcompresslevel=0

in pdfTeX. There's also normally a \special form of support for other
ideas that match up between the routes, for example for papersize. Am I
missing one here? (It would be particularly handy for xdvipdfmx, where
one normally doesn't run the driver directly.)

Joseph


More information about the tex-live mailing list