[latex3-commits] [l3svn] 06/08: Include PDF images in XeTeX using \xetex_pdffile:D

noreply at latex-project.org noreply at latex-project.org
Sun Jun 4 11:46:46 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 16a912a566985d5cec0a395e98ebddc4248bc3b3
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jun 4 07:45:11 2017 +0200

    Include PDF images in XeTeX using \xetex_pdffile:D
---
 l3kernel/l3drivers.dtx |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 74ef161..a3e5efd 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -978,7 +978,10 @@
 %  \begin{macro}[aux]{\@@_image_include_auxi:nn}
 %  \begin{macro}[aux]{\@@_image_include_auxii:nnn, \@@_image_include_auxii:xnn}
 %  \begin{macro}[aux]{\@@_image_include_auxiii:nn}
-%  The special syntax depends on the file type.
+%   The special syntax depends on the file type. There is a difference in
+%   how PDF images are best handled between |dvipdfmx| and |xdvipdfmx|: for
+%   the latter it is better to use the primitive route. The relevant code for
+%   that is included later in this file.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_image_include_eps:n #1
   {
@@ -987,8 +990,10 @@
 \cs_new_protected:Npn \@@_image_include_jpg:n #1
   { \@@_image_include_auxi:nn {#1} { image } }
 \cs_new_eq:NN \@@_image_include_png:n \@@_image_include_jpg:n
+%<*dvipdfmx>
 \cs_new_protected:Npn \@@_image_include_pdf:n #1
   { \@@_image_include_auxi:nn {#1} { epdf } }
+%</dvipdfmx>
 %    \end{macrocode}
 %   Image inclusion is set up to use the fact that each image is stored in
 %   the PDF as an XObject. This means that we can include repeated images
@@ -1164,6 +1169,22 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_image_include_pdf:n}
+%   For PDF images, properly supporting the |pagebox| concept in \XeTeX{}
+%   is best done using the |\xetex_pdffile:D| primitive. The syntax here
+%   is the same as for the image measurement part, although we know at this
+%   stage that there must be some valid setting for \cs{l__image_pagebox_tl}.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_image_include_pdf:n #1
+  {
+    \xetex_pdffile:D "#1" ~
+      \int_compare:nNnT \l__image_page_int > 0
+        { page~ \int_use:N \l__image_page_int }
+      \@@_image_getbb_auxiv:VnNnn \l__image_pagebox_tl
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</xdvipdfmx>
 %    \end{macrocode}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list