summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests/xeteximage.tex
blob: 7657ddf7918fee0d1f4c8bb4f71274311fdba841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% $Id$
% Copyright 2020 Bruno Voisin <tex-live@tug.org>
% You may freely use, modify and/or distribute this file.
%
\ifx\fmtname\undefined
  \input basic
  \def\fmtname{basic}
  \expandafter\dump
\fi
%==================
\special{pdf:minorversion 7}

\topskip0pt

\hbox{\XeTeXpicfile "1-4.jpg" width \hsize height \vsize}
\vfill\eject

\hbox{\XeTeXpdffile "B.pdf" width \hsize height \vsize}
\vfill\eject

\hbox{\XeTeXpicfile "lily-ledger-broken.png" width \hsize height \vsize}
\vfill\eject

\vbox to\vsize{\vfill%
  \special{pdf:image
    width \the\hsize
%    height \the\vsize
  (1-4.jpg)}}
\eject

\vbox to\vsize{\vfill%
  \special{pdf:epdf
    width \the\hsize
%    height \the\vsize
   (B.pdf)}}
\eject

\vbox to\vsize{\vfill%
  \special{pdf:image
    width \the\hsize
%    height \the\vsize
  (lily-ledger-broken.png)}}
\eject

\bye

Date: Sat, 16 May 2020 01:33:51 +0200
From: Bruno Voisin via tex-live <tex-live@tug.org>
To: tex-live@tug.org
Subject: Re: xetex test creation for reading pdf images?

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

Build/source/texk/web2c/luatexdir/tests/luaimage.tex

Build/source/texk/web2c/tests/1-4.jpg
Build/source/texk/web2c/tests/B.pdf
Build/source/texk/web2c/tests/lily-ledger-broken.png

Two forms of image inclusion commands are used:

- \XeTeXpicfile and \XeTeXpdffile which are the original XeTeX commands,

- \special{pdf:image and \special{pdf:epdf which are the (x)dvipdfm(x) specials,

based on XeTeX-notes.pdf, xetex-reference.pdf, dvipdfm.pdf and dvipdfmx.pdf.

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.

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.

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.)

Bruno Voisin

untyped binary data, xeteximage.tex [Press RETURN to save to a file]