diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-03 09:49:43 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-03 09:49:43 +0000 |
commit | 89807db415192c13901dc2b5c21a11bf00852c6d (patch) | |
tree | 0169eb1838ec1dad1f950e40bbe81555b08df39a /Build/source/texk | |
parent | d053b5713cf982bb8ef0c5188f09689dab61b43e (diff) |
support libdpx
git-svn-id: svn://tug.org/texlive/trunk@46794 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/xbb.c | 24 |
2 files changed, 23 insertions, 5 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index a26a1dd6ee8..94f6fb5e4cc 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,7 @@ +2018-03-03 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * xbb.c: Support libdpx. + 2018-03-02 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * epdf.c, pdfobj.c, pdfobj.h: Remove multiple warnings. diff --git a/Build/source/texk/dvipdfm-x/xbb.c b/Build/source/texk/dvipdfm-x/xbb.c index 3978d778c8e..82afc7ad259 100644 --- a/Build/source/texk/dvipdfm-x/xbb.c +++ b/Build/source/texk/dvipdfm-x/xbb.c @@ -500,6 +500,8 @@ static void do_aptex_pdf (FILE *fp, char *filename, pdf_rect * box) int page_no = Include_Page; int count; pdf_rect bbox; + pdf_tmatrix matrix; + pdf_coord p1, p2, p3, p4; pf = pdf_open(filename, fp); if (!pf) { @@ -507,7 +509,7 @@ static void do_aptex_pdf (FILE *fp, char *filename, pdf_rect * box) return; } count = pdf_doc_get_page_count(pf); - page = pdf_doc_get_page(pf, page_no, PageBox, &bbox, NULL); + page = pdf_doc_get_page(pf, page_no, PageBox, &bbox, &matrix, NULL); pdf_close(pf); @@ -516,10 +518,22 @@ static void do_aptex_pdf (FILE *fp, char *filename, pdf_rect * box) pdf_release_obj(page); - box->llx = bbox.llx; - box->lly = bbox.lly; - box->urx = bbox.urx; - box->ury = bbox.ury; + /* Image's attribute "bbox" here is affected by /Rotate entry of included + * PDF page. + */ + p1.x = bbox.llx; p1.y = bbox.lly; + pdf_dev_transform(&p1, &matrix); + p2.x = bbox.urx; p2.y = bbox.lly; + pdf_dev_transform(&p2, &matrix); + p3.x = bbox.urx; p3.y = bbox.ury; + pdf_dev_transform(&p3, &matrix); + p4.x = bbox.llx; p4.y = bbox.ury; + pdf_dev_transform(&p4, &matrix); + + box->llx = min4(p1.x, p2.x, p3.x, p4.x); + box->lly = min4(p1.y, p2.y, p3.y, p4.y); + box->urx = max4(p1.x, p2.x, p3.x, p4.x); + box->ury = max4(p1.y, p2.y, p3.y, p4.y); } void aptex_extractbb (char * pict, uint32_t page, uint32_t rect, pdf_rect * bbox) |