Skip to main content
Nikhil Ranka
Known Participant
February 17, 2023
Question

Converting PDF user units in PDF Extract API's output to browser compatible pixel values

  • February 17, 2023
  • 1 reply
  • 706 views

What formula can be used to convert PDF user units into browser-compatible measurement units (for eg: pixels)?

 

For eg: `TextDecorationThickness`'s value is in PDF user units, how should this be translated into pixels or any other browser compatible value?

This topic has been closed for replies.

1 reply

Nikhil Ranka
Known Participant
February 17, 2023

It is mentioned that 1 PDF unit is 1 inch. And 1 inch is 96 pixels. Not certain if the same math can be applied to Extract API's output 

 

Legend
February 19, 2023

PDF measurements do not use pixels. Not at all (except for the size of images, which is unconnected to their size on screen). The PDF coordinate system uses POINTS. These are exactly 1/72 inch.

"It is mentioned that 1 PDF unit is 1 inch." That is not expected. Where is this mentioned?

Nikhil Ranka
Known Participant
February 21, 2023

1 PDF Unit is 1 inch, came from a Google search. However, as per what you say, that does not seem to be the case. Sorry for the confusion.

 

Any ideas on how to translate the measurements for republishing in HTML?