Hello, New option '-accuratecoordinates' added to pdftohtml for xml purpose. It allows to generate accurate coordinates instead of rounded one when using the -xml option
-- Cordialement / Regards Thibaut Brard 2018-06-11 17:32 GMT+02:00 Thibaut Brard <[email protected]>: > Hello! > > I'm using poppler to convert PDF document into XML file and I'm facing few > problems with rounded coordinates. > > In my opinion, the xoutRound macro should be called only when generating > complex HTML documents, but not inside the dumpAsXML method (option : -xml): > when dealing with XML we wish to keep the floating precision. > (For backward-compatibility, this could be another option when calling > ./pdftohtml) > > Do you agree or did I miss anything? > > > PATCH utils\HtmlOutputDev.cc: > > 763 - fprintf(f,"<image top=\"%d\" left=\"%d\" > ",xoutRound(img->yMin),xoutRound(img->xMin)); > 764 - fprintf(f,"width=\"%d\" height=\"%d\" > ",xoutRound(img->xMax-img->xMin),xoutRound(img->yMax-img->yMin)); > 763 + fprintf(f,"<image top=\"%f\" left=\"%f\" ",img->yMin,img->xMin); > 764 + fprintf(f,"width=\"%f\" height=\"%f\" > ",img->xMax-img->xMin,img->yMax-img->yMin); > > > 771 - fprintf(f,"<text top=\"%d\" left=\"%d\" > ",xoutRound(tmp->yMin),xoutRound(tmp->xMin)); > 772 - fprintf(f,"width=\"%d\" height=\"%d\" > ",xoutRound(tmp->xMax-tmp->xMin),xoutRound(tmp->yMax-tmp->yMin)); > 771 + fprintf(f,"<text top=\"%f\" left=\"%f\" ",tmp->yMin,tmp->xMin); > 772 + fprintf(f,"width=\"%f\" height=\"%f\" > ",tmp->xMax-tmp->xMin,tmp->yMax-tmp->yMin); > > > Regards, > --Thibaut >
0001-HtmlOutputDev-dumpAsXML-Allow-generate-accurate-x-y-.patch
Description: Binary data
_______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
