Search code examples
javacssjsoupflying-saucer

How can I get the width of an HTML page with Java(Server Side)?


I have HTML files and I want to know how I can know the width of them Dynamically. I am trying to convert HTML to PDF using Flying Saucer. I am using Jsoup to add width with CSS

@page( size: wpx hpx;)

I want wpx to be dynamic depending on HTML width.


Solution

  • Try using percentages instead of pixels. or em will also work to scale things dynamically to their containers