[XeTeX] XeTeXpdffile positions differently on MacOS and Linux

Paul Howson paul-lists at tdgq.com.au
Tue May 13 22:26:30 CEST 2008


On 13/05/2008, at 6:54 PM, Jonathan Kew wrote:

> On 13 May 2008, at 9:14 am, Paul Howson wrote:
>
>> A strange problem is occurring when using \XeTeXpdffile to include  
>> PDF
>> files with smallish dimensions -- e.g. 0.41 cm × 0.48 cm.
>>
>> The included PDFs are being positioned differently on MacOS and  
>> Linux.
>
> Could you provide a complete minimal test case with .tex source, an
> example of the PDF you're including, and the results from both Mac OS
> X and Linux? I suspect that it's a difference in how the two versions
> are reading the crop box from the included PDF, or something like
> that, but it would be helpful to verify exactly what you're seeing.
>
> Also, please let me know the version of xetex you have on each  
> platform.

Hi Jonathan,

Version of xetex on OSX is:
This is XeTeXk, Version 3.141592-2.2-0.996 (Web2C 7.5.6)

Someone else runs the Linux system, so I don't have direct access to  
it. However we installed the latest versions of TexLive in the same  
week last September, so they should be identical.

Here are two PDFs of sample pages from the two systems (sorry I don't  
have access to Linux at short notice so am sending the actual sample).  
The text is slightly different, but the positioning effects are obvious:

      http://www.tdgq.com.au/download/Sample-Linux.pdf
      http://www.tdgq.com.au/download/Sample-OSX.pdf

Ignore everything except the "red flags" in the left margin. See how  
they are positioned differently. The OSX one is the correct position.  
However I had to resort to \lower and \kern to get it in the right  
place.

And here is the PDF of the included "red flag" image:

      http://www.tdgq.com.au/download/red_flag_with_stem.pdf

Here is the code which positions those red flags.
This line defines the red flag object:

\def\redflag{\smash{\raise7.25mm\hbox{\kern9.5mm\XeTeXpdffile  
red_flag_with_stem.pdf\relax}}}

And here is how it is positioned at the front of a paragraph  
(straightforward, #1 is the text of the para):

\def\flaglist#1{\list{\llap{\hbox to 17mm{\redflag\hfil}}#1}}

The \def\redflag macro is the one to look at. Notice the 9.5mm kern  
which pushes the red flag 9.5mm to the right of where it should be.  
That's necessary on OSX to make it appear at the correct horizontal  
position. On Linux however with that code it appears exactly 9.5mm too  
far to the right!! So it appears the Linux version is reading the PDF  
info correctly and the OSX version is not.

Similarly the \raise7.25mm moves the flag up for the OSX version. On  
the Linux version the flag appears 9.6mm higher than the OSX version  
(measured from a printout).

The PDF file "red_flag_with_stem.pdf" has a "page size" of 4.1mm x  
4.8mm.

Apologies for all the Adobe Illustrator "junk" in that file. You can  
find the various bounding, crop, etc boxes if you scroll down through  
the PDF source -- look for "%!PS-Adobe-3.0".

Apologies also for not having a very simple example, however the  
essence of the problem should be obvious.

Do you think this is a xetex or a xdvipdfmx problem?

Paul Howson



More information about the XeTeX mailing list