HighDots Forums  

Saving HTML content in a file

alt.html.tags alt.html.tags


Discuss Saving HTML content in a file in the alt.html.tags forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alexandr Molochnikov
 
Posts: n/a

Default Saving HTML content in a file - 11-02-2004 , 05:42 PM






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



Reply With Quote
  #2  
Old   
SpaceGirl
 
Posts: n/a

Default Re: Saving HTML content in a file - 11-02-2004 , 06:23 PM






Alexandr Molochnikov wrote:

Quote:
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 #


Reply With Quote
  #3  
Old   
SpaceGirl
 
Posts: n/a

Default Re: Saving HTML content in a file - 11-02-2004 , 06:23 PM



Alexandr Molochnikov wrote:

Quote:
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 #


Reply With Quote
  #4  
Old   
Alexandr Molochnikov
 
Posts: n/a

Default Re: Saving HTML content in a file - 11-02-2004 , 06:26 PM



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" <shit (AT) usenetshit (DOT) info> wrote

Quote:
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.



Reply With Quote
  #5  
Old   
Alexandr Molochnikov
 
Posts: n/a

Default Re: Saving HTML content in a file - 11-02-2004 , 06:30 PM



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" <NOtheSpaceGirlSPAM (AT) subhuman (DOT) net> wrote

Quote:
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 #



Reply With Quote
  #6  
Old   
SpaceGirl
 
Posts: n/a

Default Re: Saving HTML content in a file - 11-02-2004 , 06:35 PM



Alexandr Molochnikov wrote:

Quote:
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 #


Reply With Quote
  #7  
Old   
Alexandr Molochnikov
 
Posts: n/a

Default Re: Saving HTML content in a file - 11-02-2004 , 06:57 PM



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" <NOtheSpaceGirlSPAM (AT) subhuman (DOT) net> wrote

Quote:
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 #



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.