Ok, this whole thing makes about as much sense to me as it seems to be making to everyone else but here's an approach that might work.

  1. write the HTML out to file 'X' but before you do that, add a JavaScript function (triggered by onLoad) and wrap the body of the page in a div with an id 'Y'
  2. have your script fire up a browser and on its command line give it the URL of file 'X'
  3. when the JavaScript function is called, have it query the height and width properties of div 'Y' and submit these details to a CGI script
  4. have the CGI script signal your original script that it's all over and the browser process can be killed.

With Mozilla remoting, you can instruct an already running browser process to load a particular URL so I guess you could skip steps 2 and 4. Step 1 could be done on the fly by a CGI script. You could use CSS to set the width of div 'Y' to be fixed and then measure the height.


In reply to Re: Seeking ideas for measuring rendered html size by grantm
in thread Seeking ideas for measuring rendered html size by BUU

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.