| 1 |
% $Id: xeteximage.tex 61016 2021-11-10 15:35:19Z karl $ |
| 2 |
% Copyright 2020 Bruno Voisin <[email protected]> |
| 3 |
% You may freely use, modify and/or distribute this file. |
| 4 |
% |
| 5 |
\ifx\fmtname\undefined |
| 6 |
\input basic |
| 7 |
\def\fmtname{basic} |
| 8 |
\expandafter\dump |
| 9 |
\fi |
| 10 |
%================== |
| 11 |
\special{pdf:minorversion 7} |
| 12 |
|
| 13 |
\topskip0pt |
| 14 |
|
| 15 |
\hbox{\XeTeXpicfile "1-4.jpg" width \hsize height \vsize} |
| 16 |
\vfill\eject |
| 17 |
|
| 18 |
\hbox{\XeTeXpdffile "B.pdf" width \hsize height \vsize} |
| 19 |
\vfill\eject |
| 20 |
|
| 21 |
\hbox{\XeTeXpicfile "lily-ledger-broken.png" width \hsize height \vsize} |
| 22 |
\vfill\eject |
| 23 |
|
| 24 |
\vbox to\vsize{\vfill% |
| 25 |
\special{pdf:image |
| 26 |
width \the\hsize |
| 27 |
% height \the\vsize |
| 28 |
(1-4.jpg)}} |
| 29 |
\eject |
| 30 |
|
| 31 |
\vbox to\vsize{\vfill% |
| 32 |
\special{pdf:epdf |
| 33 |
width \the\hsize |
| 34 |
% height \the\vsize |
| 35 |
(B.pdf)}} |
| 36 |
\eject |
| 37 |
|
| 38 |
\vbox to\vsize{\vfill% |
| 39 |
\special{pdf:image |
| 40 |
width \the\hsize |
| 41 |
% height \the\vsize |
| 42 |
(lily-ledger-broken.png)}} |
| 43 |
\eject |
| 44 |
|
| 45 |
\bye |
| 46 |
|
| 47 |
Date: Sat, 16 May 2020 01:33:51 +0200 |
| 48 |
From: Bruno Voisin via tex-live <[email protected]> |
| 49 |
To: [email protected] |
| 50 |
Subject: Re: xetex test creation for reading pdf images? |
| 51 |
|
| 52 |
Here's a (very quickly) hacked adaptation of luaimage.tex to xetex. I commented out the format creation section at the beginning to test on my setup, after downloading |
| 53 |
|
| 54 |
Build/source/texk/web2c/luatexdir/tests/luaimage.tex |
| 55 |
|
| 56 |
Build/source/texk/web2c/tests/1-4.jpg |
| 57 |
Build/source/texk/web2c/tests/B.pdf |
| 58 |
Build/source/texk/web2c/tests/lily-ledger-broken.png |
| 59 |
|
| 60 |
Two forms of image inclusion commands are used: |
| 61 |
|
| 62 |
- \XeTeXpicfile and \XeTeXpdffile which are the original XeTeX commands, |
| 63 |
|
| 64 |
- \special{pdf:image and \special{pdf:epdf which are the (x)dvipdfm(x) specials, |
| 65 |
|
| 66 |
based on XeTeX-notes.pdf, xetex-reference.pdf, dvipdfm.pdf and dvipdfmx.pdf. |
| 67 |
|
| 68 |
There are some subtle differences between the two forms, not just their syntax but also the way they work. With the latter, specifying both the width and height in a way that alters the aspect ratio of the image does not seem to work: in this case, the image is nowhere to be seen. |
| 69 |
|
| 70 |
That's odd, because I looked at the associated xetex.def and dvipdfmx.def from the graphics package for double-checking and inspiration, and there seems to be no trick to deal with this, it seems to be business as usual with \Gin@req@width and \Gin@req@height. |
| 71 |
|
| 72 |
I won't be able to pursue the matter or maintain this file, it's just to get this thing started. (And I didn't attempt to modify the copyright at the beginning.) |
| 73 |
|
| 74 |
Bruno Voisin |
| 75 |
|
| 76 |
untyped binary data, xeteximage.tex [Press RETURN to save to a file] |