Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Saving HTML content in a file

Reply
Thread Tools

Saving HTML content in a file

 
 
Alexandr Molochnikov
Guest
Posts: n/a
 
      11-02-2004
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
 
 
 
 
brucie
Guest
Posts: n/a
 
      11-02-2004
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.****

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
 
 
 
 
SpaceGirl
Guest
Posts: n/a
 
      11-02-2004
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 #
 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      11-02-2004
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
 
Alexandr Molochnikov
Guest
Posts: n/a
 
      11-02-2004
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" <****@usenetshit.info> wrote in message
news:(E-Mail Removed)...
> 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.****
>
> 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
 
Alexandr Molochnikov
Guest
Posts: n/a
 
      11-02-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
brucie
Guest
Posts: n/a
 
      11-02-2004
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.
 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      11-02-2004
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
 
Alexandr Molochnikov
Guest
Posts: n/a
 
      11-02-2004
"brucie" <****@usenetshit.info> wrote in message
news:cw1sxzztuoi7$(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Alexandr Molochnikov
Guest
Posts: n/a
 
      11-02-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
EXCEL question saving a file saving the the first column as read only Luis Esteban Valencia ASP .Net 0 01-06-2005 07:02 PM
Getting HTML content from one Server and Saving it on another Server Rene Aube ASP General 1 12-23-2003 02:52 PM
Saving content of Html page in another server Rene Aube Javascript 3 12-23-2003 12:15 PM
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">? TheKeith HTML 20 10-29-2003 11:56 AM



Advertisments