Saving HTML content in a file

Discussion in 'HTML' started by Alexandr Molochnikov, Nov 2, 2004.

  1. I am struggling with the following problem: a Java program generates a
    report which consists of a number of text strings, horizontal lines and
    (possibly) images. All report elements have absolute position WRT the top of
    the page. I need to convert the report to HTML format to either e-mail it,
    or make it accessible over the Web.

    Generating the necessary CSS constructs to set the fonts, text positions and
    straight lines is not a problem. Handling the images is. They are stored in
    a database as BLOBs, and although the Java program can recreate .jpeg or
    ..gif files for every image retrieved from the DB, the question (to me, at
    least) is: how should the HTML content that includes images be saved? It
    cannot go all into one file (HTML does not support embedding images' binary
    data inside itself); should I create a temporary directory with separate
    files for HTML and images so that it can be served over the Web? Is there
    any way to stream the whole thing to a Web browser without saving it as
    files first?

    Any suggestion, especially from those who work in Java environment, will be
    appreciated.

    Alex Molochnikov
    Gestalt Corporation
    Alexandr Molochnikov, Nov 2, 2004
    #1
    1. Advertising

  2. Alexandr Molochnikov

    brucie Guest

    In alt.html,alt.html.tags Alexandr Molochnikov said:

    > Generating the necessary CSS constructs to set the fonts, text positions and
    > straight lines is not a problem. Handling the images is. They are stored in
    > a database as BLOBs,


    very inefficient

    > the question (to me, at least) is: how should the HTML content that
    > includes images be saved? It cannot go all into one file (HTML does
    > not support embedding images' binary data inside itself);


    yes it does
    http://moreshit.usenetshit.info/base64-thingy.shit

    supported by modern browsers and old crappy NS4.x. html has an attribute
    length limit of about 65k characters but browser support may be less.

    > should I create a temporary directory with separate files for HTML and
    > images so that it can be served over the Web?


    that would be best

    --
    the facts and opinions expressed by brucies
    l i t t l e v o i c e s
    are not necessarily the same as those held by brucie.
    brucie, Nov 2, 2004
    #2
    1. Advertising

  3. Alexandr Molochnikov

    SpaceGirl Guest

    Alexandr Molochnikov wrote:

    > I am struggling with the following problem: a Java program generates a
    > report which consists of a number of text strings, horizontal lines and
    > (possibly) images. All report elements have absolute position WRT the top of
    > the page. I need to convert the report to HTML format to either e-mail it,
    > or make it accessible over the Web.
    >
    > Generating the necessary CSS constructs to set the fonts, text positions and
    > straight lines is not a problem. Handling the images is. They are stored in
    > a database as BLOBs, and although the Java program can recreate .jpeg or
    > .gif files for every image retrieved from the DB, the question (to me, at
    > least) is: how should the HTML content that includes images be saved? It
    > cannot go all into one file (HTML does not support embedding images' binary
    > data inside itself); should I create a temporary directory with separate
    > files for HTML and images so that it can be served over the Web? Is there
    > any way to stream the whole thing to a Web browser without saving it as
    > files first?
    >
    > Any suggestion, especially from those who work in Java environment, will be
    > appreciated.
    >
    > Alex Molochnikov
    > Gestalt Corporation
    >
    >


    Hmmmf XML is your friend.


    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Nov 2, 2004
    #3
  4. Alexandr Molochnikov

    SpaceGirl Guest

    Alexandr Molochnikov wrote:

    > I am struggling with the following problem: a Java program generates a
    > report which consists of a number of text strings, horizontal lines and
    > (possibly) images. All report elements have absolute position WRT the top of
    > the page. I need to convert the report to HTML format to either e-mail it,
    > or make it accessible over the Web.
    >
    > Generating the necessary CSS constructs to set the fonts, text positions and
    > straight lines is not a problem. Handling the images is. They are stored in
    > a database as BLOBs, and although the Java program can recreate .jpeg or
    > .gif files for every image retrieved from the DB, the question (to me, at
    > least) is: how should the HTML content that includes images be saved? It
    > cannot go all into one file (HTML does not support embedding images' binary
    > data inside itself); should I create a temporary directory with separate
    > files for HTML and images so that it can be served over the Web? Is there
    > any way to stream the whole thing to a Web browser without saving it as
    > files first?
    >
    > Any suggestion, especially from those who work in Java environment, will be
    > appreciated.
    >
    > Alex Molochnikov
    > Gestalt Corporation
    >
    >


    And... "no"

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Nov 2, 2004
    #4
  5. Thanks for the speedy response. The image embedded in the given page does
    nor come out in my IE 6.0 (Win XP Pro). Instead, "brucie" is dsplayed as set
    in alt="brucie".

    Do I need to tweak something in my IE?

    Regards,

    Alex.

    "brucie" <> wrote in message
    news:...
    > In alt.html,alt.html.tags Alexandr Molochnikov said:
    >
    > > Generating the necessary CSS constructs to set the fonts, text positions

    and
    > > straight lines is not a problem. Handling the images is. They are stored

    in
    > > a database as BLOBs,

    >
    > very inefficient
    >
    > > the question (to me, at least) is: how should the HTML content that
    > > includes images be saved? It cannot go all into one file (HTML does
    > > not support embedding images' binary data inside itself);

    >
    > yes it does
    > http://moreshit.usenetshit.info/base64-thingy.shit
    >
    > supported by modern browsers and old crappy NS4.x. html has an attribute
    > length limit of about 65k characters but browser support may be less.
    >
    > > should I create a temporary directory with separate files for HTML and
    > > images so that it can be served over the Web?

    >
    > that would be best
    >
    > --
    > the facts and opinions expressed by brucies
    > l i t t l e v o i c e s
    > are not necessarily the same as those held by brucie.
    Alexandr Molochnikov, Nov 2, 2004
    #5
  6. SpaceGirl, you lost me.

    Your first response: XML is your friend
    Your next response: And... "no"

    I suppose these are the responses to different parts of my post, but which
    ones? (Esp. the "no" response).

    Alex.


    "SpaceGirl" <> wrote in message
    news:...
    > Alexandr Molochnikov wrote:
    >
    > > I am struggling with the following problem: a Java program generates a
    > > report which consists of a number of text strings, horizontal lines and
    > > (possibly) images. All report elements have absolute position WRT the

    top of
    > > the page. I need to convert the report to HTML format to either e-mail

    it,
    > > or make it accessible over the Web.
    > >
    > > Generating the necessary CSS constructs to set the fonts, text positions

    and
    > > straight lines is not a problem. Handling the images is. They are stored

    in
    > > a database as BLOBs, and although the Java program can recreate .jpeg or
    > > .gif files for every image retrieved from the DB, the question (to me,

    at
    > > least) is: how should the HTML content that includes images be saved? It
    > > cannot go all into one file (HTML does not support embedding images'

    binary
    > > data inside itself); should I create a temporary directory with separate
    > > files for HTML and images so that it can be served over the Web? Is

    there
    > > any way to stream the whole thing to a Web browser without saving it as
    > > files first?
    > >
    > > Any suggestion, especially from those who work in Java environment, will

    be
    > > appreciated.
    > >
    > > Alex Molochnikov
    > > Gestalt Corporation
    > >
    > >

    >
    > And... "no"
    >
    > --
    >
    >
    > x theSpaceGirl (miranda)
    >
    > # lead designer @ http://www.dhnewmedia.com #
    > # remove NO SPAM to email, or use form on website #
    Alexandr Molochnikov, Nov 2, 2004
    #6
  7. Alexandr Molochnikov

    brucie Guest

    In alt.html,alt.html.tags Alexandr Molochnikov said:

    > Thanks for the speedy response. The image embedded in the given page does
    > nor come out in my IE 6.0 (Win XP Pro).


    thats why i said "supported by modern browsers and old crappy NS4.x."

    > Do I need to tweak something in my IE?


    IE is not a modern browser

    please don't toppost, it upsets the little voices.

    How am I supposed to post my replies in a newsgroup?
    http://allmyfaqs.com/faq.pl?How_to_post


    --
    the facts and opinions expressed by brucies
    l i t t l e v o i c e s
    are not necessarily the same as those held by brucie.
    brucie, Nov 2, 2004
    #7
  8. Alexandr Molochnikov

    SpaceGirl Guest

    Alexandr Molochnikov wrote:

    > SpaceGirl, you lost me.
    >
    > Your first response: XML is your friend
    > Your next response: And... "no"
    >
    > I suppose these are the responses to different parts of my post, but which
    > ones? (Esp. the "no" response).
    >
    > Alex.


    Okay, XML for handling the stuff when it comes out of your database, or
    even store it natively in XML. Makes life SOOOOOOOO much easier if
    you're groing to translate it into other stuff. Especially reports.
    Using XSLT you could turn your XML report into a PDF, an XHTML web page,
    a CSV that'll load happily in Excel... whatever just using a little
    XSLT. As for the images, leave them as they are, spit them out as jpegs
    as and when needed. We do this for one project; we have scriptlets that
    generate reports in XML, and using XSLT and CSS they get turned into web
    pages. In turn we use XSLT to let the user save reports as PDF and CSV.
    Also the reports contain graphs generated by CEWOLF, which get spat out
    as jpegs, which can easily be sent to the users browser without actually
    having to be stored on the server anywhere.

    So, a combination of XML, XSLT, JSTL & scriptlets, and a bit of CSS on
    the front end. Works really well.


    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Nov 2, 2004
    #8
  9. "brucie" <> wrote in message
    news:cw1sxzztuoi7$...
    > In alt.html,alt.html.tags Alexandr Molochnikov said:
    >
    > > Thanks for the speedy response. The image embedded in the given page

    does
    > > nor come out in my IE 6.0 (Win XP Pro).

    >
    > thats why i said "supported by modern browsers and old crappy NS4.x."
    > IE is not a modern browser


    I understand, and agree that IE is more trouble than it's worth (especially
    on the security side), but whether or not to use it is not my call. Our
    product (report generator) will be used by anyone who needs it, and they
    will want to use the browser of their choosing. Do I need to tell you what
    the market is made of?

    > please don't toppost, it upsets the little voices.


    OK.

    Alex.
    Alexandr Molochnikov, Nov 2, 2004
    #9
  10. Creation of reports in PDF is not a problem. The program creates them using
    Java Graphics2D (drawing strings, lines, images etc.) and then optionally
    can convert the resulting pages into PDF using iText library with a dozen
    statements.

    HTML is, unfortunatly, not handled by iText, so we have to roll out our own
    solution.

    Can you elaborate on how you send jpegs to the clients without storing them
    on the sever? This could be a solution for me, because we don't really need
    to save the HTML content anywhere if we can help it - it is intended to be
    either served to the client browsers, or e-mailed.

    Thanks,

    Alex.

    "SpaceGirl" <> wrote in message
    news:...
    > Alexandr Molochnikov wrote:
    >
    > > SpaceGirl, you lost me.
    > >
    > > Your first response: XML is your friend
    > > Your next response: And... "no"
    > >
    > > I suppose these are the responses to different parts of my post, but

    which
    > > ones? (Esp. the "no" response).
    > >
    > > Alex.

    >
    > Okay, XML for handling the stuff when it comes out of your database, or
    > even store it natively in XML. Makes life SOOOOOOOO much easier if
    > you're groing to translate it into other stuff. Especially reports.
    > Using XSLT you could turn your XML report into a PDF, an XHTML web page,
    > a CSV that'll load happily in Excel... whatever just using a little
    > XSLT. As for the images, leave them as they are, spit them out as jpegs
    > as and when needed. We do this for one project; we have scriptlets that
    > generate reports in XML, and using XSLT and CSS they get turned into web
    > pages. In turn we use XSLT to let the user save reports as PDF and CSV.
    > Also the reports contain graphs generated by CEWOLF, which get spat out
    > as jpegs, which can easily be sent to the users browser without actually
    > having to be stored on the server anywhere.
    >
    > So, a combination of XML, XSLT, JSTL & scriptlets, and a bit of CSS on
    > the front end. Works really well.
    >
    >
    > --
    >
    >
    > x theSpaceGirl (miranda)
    >
    > # lead designer @ http://www.dhnewmedia.com #
    > # remove NO SPAM to email, or use form on website #
    Alexandr Molochnikov, Nov 2, 2004
    #10
  11. Alexandr Molochnikov

    brucie Guest

    In alt.html Alexandr Molochnikov said:

    > Our product (report generator) will be used by anyone who needs it,
    > and they will want to use the browser of their choosing. Do I need to
    > tell you what the market is made of?


    i don't care if your users are all brain dead morons i was just
    correcting your assumption that images couldn't be embedded in html.

    --
    the facts and opinions expressed by brucies
    l i t t l e v o i c e s
    are not necessarily the same as those held by brucie.
    brucie, Nov 3, 2004
    #11
  12. "brucie" <> wrote in message
    news:...
    > In alt.html Alexandr Molochnikov said:
    >
    > > Our product (report generator) will be used by anyone who needs it,
    > > and they will want to use the browser of their choosing. Do I need to
    > > tell you what the market is made of?

    >
    > i don't care if your users are all brain dead morons i was just
    > correcting your assumption that images couldn't be embedded in html.


    Thank you for the response. Since our report generator is an open market
    product, and the users are whoever chooses to acquire it, I strongly
    encourage you to protect your dignity by staying away from it, lest you
    become one of those "brain dead morons".

    Alex.
    Alexandr Molochnikov, Nov 3, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Kandell
    Replies:
    4
    Views:
    4,152
    eeebop
    Dec 10, 2004
  2. Luis Esteban Valencia
    Replies:
    0
    Views:
    2,505
    Luis Esteban Valencia
    Jan 6, 2005
  3. hazz
    Replies:
    6
    Views:
    49,536
    SkyUCHC
    Jun 9, 2010
  4. Rene Aube
    Replies:
    1
    Views:
    109
    Bob Barrows
    Dec 23, 2003
  5. Rene Aube
    Replies:
    3
    Views:
    110
    Hywel Jenkins
    Dec 23, 2003
Loading...

Share This Page