&xMin, &yMin, &xMax, &yMax)) {
result.page_num = pdf_document->page;
- result.highlight_area.x = xMin + pdf_document->page_x_offset;
- result.highlight_area.y = yMin + pdf_document->page_y_offset;
+ result.highlight_area.x = xMin;
+ result.highlight_area.y = yMin;
result.highlight_area.width = xMax - xMin;
result.highlight_area.height = yMax - yMin;
result.page_num = pdf_document->page;
- result.highlight_area.x = xMin + pdf_document->page_x_offset;
- result.highlight_area.y = yMin + pdf_document->page_y_offset;
+ result.highlight_area.x = xMin;
+ result.highlight_area.y = yMin;
result.highlight_area.width = xMax - xMin;
result.highlight_area.height = yMax - yMin;
char *title = NULL;
Object info;
+ if (pdf_document->doc == NULL)
+ return NULL;
pdf_document->doc->getDocInfo (&info);
if (info.isDict ()) {
return NULL;
}
- /* Zoom */
- link_x = x / pdf_document->scale;
- link_y = y / pdf_document->scale;
-
/* Offset */
- link_x -= pdf_document->page_x_offset;
- link_y -= pdf_document->page_y_offset;
+ link_x = x - pdf_document->page_x_offset;
+ link_y = y - pdf_document->page_y_offset;
/* Inverse y */
link_y = pdf_document->out->getBitmapHeight() - link_y;
+ /* Zoom */
+ link_x = link_x / pdf_document->scale;
+ link_y = link_y / pdf_document->scale;
+
action = pdf_document->links->find (link_x, link_y);
if (action) {