*** poppler-0.8.7.orig/utils/pdftotext.cc 2008-03-26 20:38:52.000000000 +0100 --- poppler-0.8.7/utils/pdftotext.cc 2009-02-25 09:24:13.000000000 +0100 *************** *** 37,42 **** --- 37,47 ---- static int firstPage = 1; static int lastPage = 0; + static double resolution = 72.0; + static int x = 0; + static int y = 0; + static int w = 0; + static int h = 0; static GBool physLayout = gFalse; static GBool rawOrder = gFalse; static GBool htmlMeta = gFalse; *************** *** 54,59 **** --- 59,77 ---- "first page to convert"}, {"-l", argInt, &lastPage, 0, "last page to convert"}, + + {"-r", argFP, &resolution, 0, + "resolution, in DPI (default is 72)"}, + + {"-x", argInt, &x, 0, + "x-coordinate of the crop area top left corner"}, + {"-y", argInt, &y, 0, + "y-coordinate of the crop area top left corner"}, + {"-W", argInt, &w, 0, + "width of crop area in pixels (default is 0)"}, + {"-H", argInt, &h, 0, + "height of crop area in pixels (default is 0)"}, + {"-layout", argFlag, &physLayout, 0, "maintain original physical layout"}, {"-raw", argFlag, &rawOrder, 0, *************** *** 244,251 **** textOut = new TextOutputDev(textFileName->getCString(), physLayout, rawOrder, htmlMeta); if (textOut->isOk()) { ! doc->displayPages(textOut, firstPage, lastPage, 72, 72, 0, gTrue, gFalse, gFalse); } else { delete textOut; exitCode = 2; --- 262,280 ---- textOut = new TextOutputDev(textFileName->getCString(), physLayout, rawOrder, htmlMeta); if (textOut->isOk()) { ! if ((w==0) && (h==0) && (x==0) && (y==0)) { ! doc->displayPages(textOut, firstPage, lastPage, resolution, resolution, 0, gTrue, gFalse, gFalse); + } else { + int page; + + for (page = firstPage; page <= lastPage; ++page) { + doc->displayPageSlice(textOut, page, resolution, resolution, 0, + gTrue, gFalse, gFalse, + x, y, w, h); + } + } + } else { delete textOut; exitCode = 2;