You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Pradhan C N <pr...@gmail.com> on 2013/05/12 06:10:21 UTC
Inconsistent results char glyps with versions 1.6.1 and 1.8.1
Hi,
I ran the exmaple org.apache.pdfbox.examples.util.PrintTextLocations with
two different versions of pdfBox. The results are accurate with version
1.8.1. When I run against version 1.6.1 I get incorrect height for the char
glyphs. Is there any extra setting to get the right results while using
1.6.1 ?
Here's the code snippet I am running
PrintTextLocations printer = new PrintTextLocations();
List allPages = document.getDocumentCatalog().getAllPages();
for (int i = 0; i < allPages.size(); i++) {
PDPage page = (PDPage) allPages.get(i);
System.out.println("Processing page: " + i);
PDStream contents = page.getContents();
if (contents != null) {
printer.processStream(page, page.findResources(),
page.getContents().getStream());
}
.......
Thanks,
pradhan
Re: Inconsistent results char glyps with versions 1.6.1 and 1.8.1
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
Am 12.05.2013 06:10, schrieb Pradhan C N:
> Hi,
> I ran the exmaple org.apache.pdfbox.examples.util.PrintTextLocations with
> two different versions of pdfBox. The results are accurate with version
> 1.8.1. When I run against version 1.6.1 I get incorrect height for the char
> glyphs. Is there any extra setting to get the right results while using
> 1.6.1 ?
No, there isn't. It's simplier than that. A bugfix is responsible for the
improvement. Saying that, you have to update to 1.8.1, if you want accurate
results,
> Here's the code snippet I am running
>
> PrintTextLocations printer = new PrintTextLocations();
>
> List allPages = document.getDocumentCatalog().getAllPages();
>
> for (int i = 0; i < allPages.size(); i++) {
>
> PDPage page = (PDPage) allPages.get(i);
>
> System.out.println("Processing page: " + i);
>
> PDStream contents = page.getContents();
>
> if (contents != null) {
>
> printer.processStream(page, page.findResources(),
> page.getContents().getStream());
>
> }
>
> .......
>
>
>
> Thanks,
>
> pradhan
BR
Andreas Lehmkühler