diff options
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/pdfimage.cpp | 24 |
2 files changed, 28 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index 18c4be0866d..668f746f51a 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,8 @@ +2017-03-17 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * pdfimage.cpp: Support /Rotate in PDF image inclusion with + the new xdvipdfmx-20170806. + 2017-07-17 Jonathan Kew <jfkthame@gmail.com> * xetex.ch: Set a non-zero exit code if the pipe diff --git a/Build/source/texk/web2c/xetexdir/pdfimage.cpp b/Build/source/texk/web2c/xetexdir/pdfimage.cpp index 8538913692c..fc3e3269340 100644 --- a/Build/source/texk/web2c/xetexdir/pdfimage.cpp +++ b/Build/source/texk/web2c/xetexdir/pdfimage.cpp @@ -1,7 +1,7 @@ /****************************************************************************\ Part of the XeTeX typesetting system Copyright (c) 1994-2008 by SIL International - Copyright (c) 2009, 2011 by Jonathan Kew + Copyright (c) 2009, 2017 by Jonathan Kew SIL Author(s): Jonathan Kew @@ -98,6 +98,28 @@ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box) break; } + int RotAngle = 0; + RotAngle = (int)page->getRotate() % 360; + if (RotAngle < 0) + RotAngle += 360; + if (RotAngle == 90 || RotAngle == 270) { + double tmpvalue; + if (r->x1 > r->x2) { + tmpvalue = r->x1; + r->x1 = r->x2; + r->x2 = tmpvalue; + } + if (r->y1 > r->y2) { + tmpvalue = r->y1; + r->y1 = r->y2; + r->y2 = tmpvalue; + } + + tmpvalue = r->x2; + r->x2 = r->x1 + r->y2 - r->y1; + r->y2 = r->y1 + tmpvalue - r->x1; + } + box->x = 72.27 / 72 * my_fmin(r->x1, r->x2); box->y = 72.27 / 72 * my_fmin(r->y1, r->y2); box->wd = 72.27 / 72 * fabs(r->x2 - r->x1); |