summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgerwk <sgerwk>2020-05-23 10:37:01 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-05-23 18:14:56 +0000
commite4ac9761a269805cc8510a11b47e2381ad668215 (patch)
tree4a26cc9f0cd2fc4c4bad2a2e4e2fb239f524c303
parentcdf623865df5343425c2eaea49124c6b45529bea (diff)
include annotations in the bounding box
-rw-r--r--glib/poppler-page.cc8
-rw-r--r--glib/tests/CMakeLists.txt4
2 files changed, 6 insertions, 6 deletions
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index 33023998..c3002b91 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -2227,7 +2227,6 @@ poppler_page_get_crop_box (PopplerPage *page, PopplerRectangle *rect)
gboolean
poppler_page_get_bounding_box (PopplerPage *page,
PopplerRectangle *rect) {
- Gfx *gfx;
BBoxOutputDev *bb_out;
bool hasGraphics;
@@ -2236,14 +2235,14 @@ poppler_page_get_bounding_box (PopplerPage *page,
bb_out = new BBoxOutputDev();
- gfx = page->page->createGfx(bb_out,
+ page->page->displaySlice(bb_out,
72.0, 72.0, 0,
false, /* useMediaBox */
true, /* Crop */
-1, -1, -1, -1,
false, /* printing */
- nullptr, nullptr);
- page->page->display(gfx);
+ nullptr, nullptr,
+ nullptr, nullptr);
hasGraphics = bb_out->getHasGraphics();
if (hasGraphics) {
rect->x1 = bb_out->getX1();
@@ -2252,7 +2251,6 @@ poppler_page_get_bounding_box (PopplerPage *page,
rect->y2 = bb_out->getY2();
}
- delete gfx;
delete bb_out;
return hasGraphics;
}
diff --git a/glib/tests/CMakeLists.txt b/glib/tests/CMakeLists.txt
index 10b65b57..591c5982 100644
--- a/glib/tests/CMakeLists.txt
+++ b/glib/tests/CMakeLists.txt
@@ -22,7 +22,7 @@ poppler_add_test(poppler-check-bb BUILD_GTK_TESTS ${poppler_check_bb_SRCS})
target_link_libraries(poppler-check-bb poppler-glib ${GTK3_LIBRARIES})
poppler_add_testcase(poppler-check-bb shapes+attachments.pdf 42.5 42.5 557.5 557.5)
poppler_add_testcase(poppler-check-bb orientation.pdf 34 34 83.74 49 793 34 808 97.19 488.02 793 561 808 34 503.61 49 56)
-poppler_add_testcase(poppler-check-bb xr01.pdf 148.71 127.85 308.11 704.57)
+poppler_add_testcase(poppler-check-bb xr01.pdf 148.71 126.35 308.11 704.57)
poppler_add_testcase(poppler-check-bb xr02.pdf 133.77 124.81 308.11 704.57 133.77 124.80 308.11 704.57)
poppler_add_testcase(poppler-check-bb russian.pdf 71.5 76.81 197.69 131.09)
poppler_add_testcase(poppler-check-bb vis_policy_test.pdf 90 77.93 312.01 265.13)
@@ -38,6 +38,8 @@ poppler_add_testcase(poppler-check-bb imageretrieve+attachment.pdf 0 0 610.56 79
poppler_add_testcase(poppler-check-bb checkbox_issue_159.pdf 2.84 14.17 553.18 840.87)
poppler_add_testcase(poppler-check-bb NestedLayers.pdf 0 191 612 792)
poppler_add_testcase(poppler-check-bb A6EmbeddedFiles.pdf 18 18 558.36 751.92)
+poppler_add_testcase(poppler-check-bb latex-hyperref-checkbox-issue-655.pdf 148.71 123.81 308.11 704.57)
+poppler_add_testcase(poppler-check-bb utf16le-annot.pdf 52.98 55.61 101.23 95.29)
add_executable(pdfdrawbb pdfdrawbb.c)
target_link_libraries(pdfdrawbb poppler-glib)