Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there some PDF editor/viewer for Linux or Windows that can show me a position of selected element and documet size in inches?

share|improve this question
add comment

1 Answer

I've found a console tool written in Ruby called pdf-extract, which is able to show text regions and document size in pixels. I'm not sure will it work for Windows, but in Linux it works pretty nice (except that its dependency pdf-reader version 1.1.1 should be installed, higher version don't work).

Example usage:

pdf-extract extract --regions file.pdf

Example output:

<?xml version="1.0"?>
<pdf>
  <page width="612" height="792" number="1">
    <region x="40.73" y="682.68" width="62.53" height="4.47" line_height="4.47" font="CHRUEN+MetaPlusMedium-Roman">
      <line x_offset="0.0" y_offset="0.0" spacing="0.0">xxxx</line>
    </region>
    <region x="41.65" y="669.18" width="60.69" height="4.47" line_height="4.47" font="CHRUEN+MetaPlusMedium-Roman">
      <line x_offset="0.0" y_offset="0.0" spacing="0.0">xxxx</line>
    </region>
    <region x="40.81" y="655.68" width="62.38" height="4.47" line_height="4.47" font="CHRUEN+MetaPlusMedium-Roman">
      <line x_offset="0.0" y_offset="0.0" spacing="0.0">xxxx</line>
    </region>
    <region x="19.48" y="640.69" width="5.86" height="5.9" line_height="5.9" font="XBCKNX+AGaramond-Italic">
      <line x_offset="0.0" y_offset="0.0" spacing="0.0">xxx</line>
    </region>
    <region x="27.44" y="640.69" width="97.07" height="5.96" line_height="4.47" font="CHRUEN+MetaPlusMedium-Roman">
      <line x_offset="0.0" y_offset="1.49" spacing="0.0">xxx</line>
      <line x_offset="44.96" y_offset="0.0" spacing="-4.42">xxx</line>
    </region>
    <region x="43.18" y="628.68" width="57.64" height="4.47" line_height="4.47" font="CHRUEN+MetaPlusMedium-Roman">
      <line x_offset="0.0" y_offset="0.0" spacing="0.0">xxxx</line>
    </region>
  </page>
</pdf>

Where "xxx" is actual text

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.