[XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo
Zdenek Wagner
zdenek.wagner at gmail.com
Sun Jul 10 17:46:47 CEST 2016
I have the following code in zwpagelayout.sty:
\edef\zwpl at pdftitle{\zwpl at title}
\ifcat$\zwpl at pdftitle$
\ifzwpl at pdfx
\ifcase\zwpl at Driver
\or
\pdfinfo{\zwpl at pdfinfo}
\or
\ifxetex \def\zwpl at crt{XeTeX}\else \def\zwpl at crt{TeX+dvipdfm}\fi
\edef\zwpl at pdfcrt{ /Creator (\zwpl at crt) }
\special{pdf:docinfo << \zwpl at pdfmoddate \zwpl at pdfcrt \zwpl at pdfxinfo >>}
\fi
\fi
\else
\edef\zwpl at pdftitle{/Title (\zwpl at pdftitle)}
\ifcat$\zwpl at author$\def\zwpl at pdfauthor{}\else
\edef\zwpl at pdfauthor{ /Author (\zwpl at author)}\fi
\ifcat$\zwpl at subject$\def\zwpl at pdfsubject{}\else
\edef\zwpl at pdfsubject{ /Subject (\zwpl at subject)}\fi
\ifcat$\zwpl at keywords$\def\zwpl at pdfkeywords{}\else
\edef\zwpl at pdfkeywords{ /Keywords (\zwpl at keywords)}\fi
\edef\zwpl at pdfcreationdate{ /CreationDate \zwpl at modt}
\edef\zwpl at pdfmoddate{ /ModDate \zwpl at modt}
\ifcase\zwpl at Driver
\or
\pdfinfo{\zwpl at pdftitle \zwpl at pdfauthor \zwpl at pdfsubject
\zwpl at pdfkeywords \zwpl at pdfxinfo}
\or
\ifxetex \def\zwpl at crt{XeTeX}\else \def\zwpl at crt{TeX+dvipdfm}\fi
\edef\zwpl at pdfcrt{ /Creator (\zwpl at crt) }
\special{pdf:docinfo << \zwpl at pdftitle \zwpl at pdfauthor
\zwpl at pdfsubject \zwpl at pdfkeywords
\zwpl at pdfmoddate \zwpl at pdfcrt \zwpl at pdfxinfo >>}
\else
\def\zwpl at pdfcrt{ /Creator (TeX+dvips) }
\special{ps:[ \zwpl at pdftitle \zwpl at pdfauthor \zwpl at pdfsubject
\zwpl at pdfkeywords
\zwpl at pdfcreationdate \zwpl at pdfmoddate \zwpl at pdfcrt
/DOCINFO pdfmark}
\fi
\fi
I can see the texts in pdfinfo as well as in Acrobat.
Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz
2016-07-10 17:38 GMT+02:00 Philip Taylor <P.Taylor at rhul.ac.uk>:
>
> Jonathan Kew wrote:
>> [Y]ou could generate a minimal .xdv file with xelatex (using -no-pdf) and then examine this with a binary-capable editor/viewer to see what pdf specials have been inserted. Then write plain-based code to generate the same in your xetex document.
>
> Thank you Jonathan -- that may have led me to a solution. I could generate the .xdv with no problem, but even looking at it using DVIASM did not give me sufficient information to work out what \specials might exist. So instead I added the following to my XeLaTeX code :
>
> \let \Special = \special
> \def \special #1{\message {\string \special: [#1]\Special {#1}}}
>
> and this yields in the transcript :
>
> \special: [pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>]\Specia
> l {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>]\Specia
> l {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
> \special: [pdf:docinfo << /GTS_PDFXVersion (PDF/X-1:2001) /GTS_PDFXConformance
> (PDF/X-1a:2001) >> ]\Special {pdf:docinfo << /GTS_PDFXVersion (PDF/X-1:2001) /G
> TS_PDFXConformance (PDF/X-1a:2001) >> }
> \special: [pdf:put @catalog << /PageMode /UseNone /OutputIntents [ << /Info (no
> ne) /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier (Custom) /Regis
> tryName (http://www.color.org/) >> ] >> ]\Special {pdf:put @catalog << /PageMod
> e /UseNone /OutputIntents [ << /Info (none) /Type /OutputIntent /S /GTS_PDFX /O
> utputConditionIdentifier (Custom) /RegistryName (http://www.color.org/) >> ] >>
> } (d:/TeX/Live/2014/texmf-dist/tex/generic/oberdiek/se-ascii-print.def)
> \special: [pdf:dest (page.1) [@thispage /XYZ @xpos @ypos null]]\Special {pdf:de
> st (page.1) [@thispage /XYZ @xpos @ypos null]}
> \special: [pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>]\Specia
> l {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>]\Specia
> l {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
> \special: [pdf:docinfo<</Title(DocTitle)/Subject()/Creator(LaTeX with hyperref
> package)/ModDate(D:20160710163100)/Author()/Producer(XeTeX 0.99996)/Keywords()/
> Trapped/False>>]\Special {pdf:docinfo<</Title(DocTitle)/Subject()/Creator(LaTeX
> with hyperref package)/ModDate(D:20160710163100)/Author()/Producer(XeTeX 0.999
> 96)/Keywords()/Trapped/False>>}
>
> Obviously that will require massaging to rejoin the fractured lines, but it will be interesting to see whether it then yields viable Plain XeTeX code. I sdhall; report back.
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
> http://tug.org/mailman/listinfo/xetex
More information about the XeTeX
mailing list