#676238 Unable to convert PDF to xml using pdftohtml (empty pages)

Package:
poppler-utils
Source:
poppler
Description:
PDF utilities (based on Poppler)
Submitter:
Petter Reinholdtsen
Date:
2023-07-06 10:24:10 UTC
Severity:
normal
Tags:
#676238#5
Date:
2012-06-05 15:07:29 UTC
From:
To:
When I convert
<URL: http://nrk.no/contentfile/file/1.8116520!offentligjournal02052012.pdf >
to XML using

  pdftohtml -xml -noframes 1.8116520\!offentligjournal02052012.pdf

I get the following content-less XML file.  I find this rather strange,
as the PDF is searchable using xpdf, okular and evince.  Any idea where
the text went?  Anything I can do to get access to the text as XML?

This is the output I get:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pdf2xml SYSTEM "pdf2xml.dtd">

<pdf2xml>
<page number="1" position="absolute" top="0" left="0" height="792" width="612">
        <fontspec id="0" size="18" family="Helvetica" color="#000000"/>
        <fontspec id="1" size="5" family="Helvetica" color="#000000"/>
        <fontspec id="2" size="5" family="Helvetica" color="#000000"/>
        <fontspec id="3" size="7" family="Helvetica" color="#000000"/>
</page>
<page number="2" position="absolute" top="0" left="0" height="792" width="612">
        <fontspec id="4" size="6" family="Helvetica" color="#000000"/>
</page>
<page number="3" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="4" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="5" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="6" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="7" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="8" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="9" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="10" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="11" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="12" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="13" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="14" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="15" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="16" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="17" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="18" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="19" position="absolute" top="0" left="0" height="792" width="612">
</page>
<page number="20" position="absolute" top="0" left="0" height="792" width="612">
</page>
</pdf2xml>

#676238#10
Date:
2012-06-05 16:29:20 UTC
From:
To:
I've also reported this upstream,
<URL: https://bugs.freedesktop.org/show_bug.cgi?id=50739 >.

#676238#15
Date:
2012-06-21 10:42:48 UTC
From:
To:
forwarded 676238 https://bugs.freedesktop.org/show_bug.cgi?id=50739
found 676238 poppler/0.18.4-2
tag 676238 + confirmed
thanks

Hi Petter,

Alle martedì 5 giugno 2012, Petter Reinholdtsen ha scritto:

Hm it is an old poppler (the one in stable), though...

... this problem can be reproduced also with poppler 0.18.4, currently
in wheezy.

Note adding also -hidden to the arguments makes the text show up in the
XML output.

Added forwarding.

Thanks for your report,

#676238#26
Date:
2012-06-29 21:10:13 UTC
From:
To:
[Pino Toscano]

Thank you for the hint.  It provide me with a workaround that allow my
PDF scraper to work.  No idea what hidden text in PDFs are, but
apparenly some PDFs only got hidden text. :)

Now <URL: http://www.scraperwiki.com/ > got support for handling PDFs
with hidden text, and I can continue my project scraping public
information. :)