Hi, The page size output is based on the CropBox size, but the coordinates are relative to the MediaBox size. In other words, if the CropBox is not equal to the MediaBox, there is no way of making sense of the coordinates.
Thanks, Tom -- Tom Gleason, PHP Developer ResourceSpace Support Services https://www.buildadam.com/muse2 Exploring ResourceSpace at: http://resourcespace.blogspot.com
From ea1e0ca06f20e8363529973165bba988f388b26a Mon Sep 17 00:00:00 2001 From: Tom Gleason <[email protected]> Date: Sun, 24 Apr 2011 00:17:38 -0400 Subject: [PATCH] bbox coordinates are relative to MediaBox size, not CropBox size --- utils/pdftotext.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc index 5676680..a67a9eb 100644 --- a/utils/pdftotext.cc +++ b/utils/pdftotext.cc @@ -341,7 +341,7 @@ int main(int argc, char *argv[]) { if (textOut->isOk()) { fprintf(f, "<doc>\n"); for (int page = firstPage; page <= lastPage; ++page) { - fprintf(f, " <page width=\"%f\" height=\"%f\">\n",doc->getPageCropWidth(page), doc->getPageCropHeight(page)); + fprintf(f, " <page width=\"%f\" height=\"%f\">\n",doc->getPageMediaWidth(page), doc->getPageMediaHeight(page)); doc->displayPage(textOut, page, resolution, resolution, 0, gTrue, gFalse, gFalse); TextWordList *wordlist = textOut->makeWordList(); const int word_length = wordlist != NULL ? wordlist->getLength() : 0; -- 1.7.1
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
