Skip to main content
Known Participant
February 24, 2023
Question

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

  • February 24, 2023
  • 1 reply
  • 2593 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

Joel Geraci
Community Expert
Community Expert
February 24, 2023

Generally, the units are 72 points per inch. Also, note that the coordinate system has it's origin (0,0) at the bottom left of the page. The values are already browser compatible in that you can use "xx pt" to represent points in CSS.

InqutecAuthor
Known Participant
February 25, 2023

 

That makes republishing simpler! Thanks for the clarity @Joel Geraci. So, would it be correct to assume that the co-ordinates mentioned in BBox can be represented as "xx pt" without any conversion?

 

While I will refer to the schema here when required, is there anything else one needs to consider when using the co-ordinate values?

InqutecAuthor
Known Participant
March 9, 2023

There's no right answer, because this is not a standardised or recognised process. Adobe's demos just demo technology, they aren't necessarily good models for production. You need to do your own tests in as many use cases as possible. Be sure to test in mobile browsers, and on high pixel density monitors.


Yes, this is not a standardized or recognised process. However, was looking to see if Adobe or @Joel Geraci had some insights to share here.