Saving HTML content in a file

  • Thread starter Alexandr Molochnikov
  • Start date
A

Alexandr Molochnikov

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
 
B

brucie

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
 
S

SpaceGirl

Alexandr said:
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 #
 
S

SpaceGirl

Alexandr said:
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 #
 
A

Alexandr Molochnikov

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.
 
A

Alexandr Molochnikov

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.
 
B

brucie

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
 
S

SpaceGirl

Alexandr said:
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 #
 
A

Alexandr Molochnikov

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


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.
 
A

Alexandr Molochnikov

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.
 
B

brucie

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.
 
A

Alexandr Molochnikov

brucie said:
In alt.html Alexandr Molochnikov said:


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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top