<div dir="ltr"><div>Hello,</div><div><br></div><div>New option '-accuratecoordinates' added to pdftohtml for xml purpose.</div><div>It allows to generate accurate coordinates instead of rounded one when using the -xml option<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br>--<br>Cordialement / Regards<br>Thibaut Brard<br></div></div></div></div>
<br><div class="gmail_quote">2018-06-11 17:32 GMT+02:00 Thibaut Brard <span dir="ltr"><<a href="mailto:thibaut.brard@gmail.com" target="_blank">thibaut.brard@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div dir="ltr">
Hello!<br clear="all"><div><div><div class="m_6738765945100792019gmail-m_5233852375662242939gmail-m_-9208669814854298963gmail_signature"><div dir="ltr"><div><br></div><div>I'm using poppler to convert PDF document into XML file and I'm facing few problems with rounded coordinates.</div><div><br></div><div>In my opinion, the <span style="font-family:monospace,monospace">xoutRound</span> macro should be called only when generating complex HTML documents, but not inside the <span style="font-family:monospace,monospace">dumpAsXML</span> method (option : <span style="font-family:monospace,monospace">-xml</span>): when dealing with XML we wish to keep the floating precision.</div><div>(For backward-compatibility, this could be another option when calling <span style="font-family:monospace,monospace">./pdftohtml</span>)<br></div><div><br></div><div>Do you agree or did I miss anything?</div><div><br></div><div><br></div><div>PATCH utils\HtmlOutputDev.cc:<br></div><div><br></div><div>  763  - fprintf(f,"<image top=\"%d\" left=\"%d\" ",xoutRound(img->yMin),xoutRou<wbr>nd(img->xMin));<br>  764  - fprintf(f,"width=\"%d\" height=\"%d\" ",xoutRound(img->xMax-img->xMi<wbr>n),xoutRound(img->yMax-img-><wbr>yMin));<br>  763  + fprintf(f,"<image top=\"%f\" left=\"%f\" ",img->yMin,img->xMin);<br>  764  + fprintf(f,"width=\"%f\" height=\"%f\" ",img->xMax-img->xMin,img->yMa<wbr>x-img->yMin);</div><div><br></div><div><br></div><div>  771  - fprintf(f,"<text top=\"%d\" left=\"%d\" ",xoutRound(tmp->yMin),xoutRou<wbr>nd(tmp->xMin));<br>  772  - fprintf(f,"width=\"%d\" height=\"%d\" ",xoutRound(tmp->xMax-tmp->xMi<wbr>n),xoutRound(tmp->yMax-tmp-><wbr>yMin));<br>  771  + fprintf(f,"<text top=\"%f\" left=\"%f\" ",tmp->yMin,tmp->xMin);<br>  772  + fprintf(f,"width=\"%f\" height=\"%f\" ",tmp->xMax-tmp->xMin,tmp->yMa<wbr>x-tmp->yMin);<br></div><div><br></div><div><br>Regards,<br></div><div>--Thibaut</div></div></div></div></div>

</div>
</div></div></blockquote></div><br></div>