Commit e4ac9761 authored by sgerwk's avatar sgerwk Committed by Albert Astals Cid

include annotations in the bounding box

parent cdf62386
......@@ -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;
}
......
......@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment