[poppler] Analysing 3 pages at a time with one function

Josh Richardson jric at chegg.com
Mon Oct 24 15:21:06 PDT 2011


What are you trying to do?  What's your algorithm?  Did you decide against
the second-pass approach on the XML files?

--josh

On 10/24/11 1:57 PM, "Alec Taylor" <alec.taylor6 at gmail.com> wrote:

>Good morning,
>
>How do I analyse 3 pages at a time, using the one function?
>
>Thanks for all suggestions,
>
>Alec Taylor
>
>FYI: You'll find my attempt below
>
>[utils/pdftohtml.cc]
>
><snipped>
>
>GBool analyseThree(PDFDoc*, SplashOutputDev*, int, int, int);
>
>int main(int argc, char *argv[]) {
>
><snipped>
>
>      for (int pg = firstPage; pg <= lastPage; ++pg) {
>        if(!generateHeaderFooter)
>        doc->displayPage(splashOut, pg,
>                         72 * scale, 72 * scale,
>                         0, gTrue, gFalse, gFalse);
>        else
>            if(pg+1<lastPage && pg+2<lastPage)
>                analyseThree(*doc, *splashOut, pg, pg+1, pg+2);
>
>        SplashBitmap *bitmap = splashOut->getBitmap();
>
>        imgFileName = GooString::format("{0:s}{1:03d}.{2:s}",
>            htmlFileName->getCString(), pg, extension);
>
>        bitmap->writeImgFile(format, imgFileName->getCString(),
>                             72 * scale, 72 * scale);
>
>        delete imgFileName;
>      }
>
><snipped>
>
>GBool analyseThree(PDFDoc *doc, SplashOutputDev *splashOut, int first,
>int second, int third) {
>    doc->displayPage(splashOut, first, 72 * scale, 72 * scale, 0,
>gTrue, gFalse, gFalse);
>    doc->displayPage(splashOut, second, 72 * scale, 72 * scale, 0,
>gTrue, gFalse, gFalse);
>    doc->displayPage(splashOut, third, 72 * scale, 72 * scale, 0,
>gTrue, gFalse, gFalse);
>
>    return gTrue;
>}
>_______________________________________________
>poppler mailing list
>poppler at lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/poppler
>



More information about the poppler mailing list