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?

Joel Geraci
Community Expert
Community Expert
February 28, 2023

Hmm, yes. Conversion between absolute units and relative units is not usually advisable and device dependent.

Can you confirm if using `pt` for styling in email templates had been tested to see if it works well?

It is understandable that this is tricky, because PDFs are for read-only or, printing purposes which explains the choice of using absolute units. Wanting to understand from Adobe's experience to know what works best for use for on-screen purposes. especially when the W3 specs advice using relative units.


HTML email isn't something I have any expertise in.