Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   printing HTML from Swing app in Windows ... (http://www.velocityreviews.com/forums/t137241-printing-html-from-swing-app-in-windows.html)

Giovanni Azua 09-28-2004 05:17 PM

printing HTML from Swing app in Windows ...
 
Hello all,

I have a Swing application that dynamically
generates HTML documents, I need to let the
user print the document but because of the
little support of HTML flavor I could not have
the Print Service API working for me.

Another important remark is that this app is
currently only used in Windows. Is there a way
to have the explorer directly print the html
document I have tried something like e.g.

Runtime.getRuntime().exec("explorer -print " + url.toString());

using the Windows Shell but does not work
i.e. explorer does not print directly a file.

Thanks in advance,
Best Regards,
Giovanni



Tim Jowers 09-29-2004 04:21 PM

Re: printing HTML from Swing app in Windows ...
 
"Giovanni Azua" <bravegag@hotmail.com> wrote in message news:<2rtktjF1e6sjhU1@uni-berlin.de>...
> Hello all,
>
> I have a Swing application that dynamically
> generates HTML documents, I need to let the
> user print the document but because of the
> little support of HTML flavor I could not have
> the Print Service API working for me.
>
> Another important remark is that this app is
> currently only used in Windows. Is there a way
> to have the explorer directly print the html
> document I have tried something like e.g.
>
> Runtime.getRuntime().exec("explorer -print " + url.toString());
>


Giovanni,
post to an IE group. I think the Windows Scripting Host (WSH) will
probably be what you are looking for to cause IE to print. Or maybe an
old-school Windows app that sendMessage. One other lazy way will be to
put a JavaScript in each HTML file. onload it can call to print.

Best luck,
Tim

> using the Windows Shell but does not work
> i.e. explorer does not print directly a file.
>
> Thanks in advance,
> Best Regards,
> Giovanni


Gerbrand van Dieijen 09-29-2004 10:58 PM

Re: printing HTML from Swing app in Windows ...
 
On Tue, 28 Sep 2004 19:17:30 +0200, Giovanni Azua wrote:
>Hello all,
>
>I have a Swing application that dynamically
>generates HTML documents, I need to let the
>user print the document but because of the
>little support of HTML flavor I could not have
>the Print Service API working for me.
>


Hello,

Using JEditorPane, you render and then print HTML documents.

I've used the DocumentRenderer class to print:
http://www.ftponline.com/javapro/cod...e=jpep021210kg

(I implemented my own printable jeditorpane first, but this one was
slightly better, like multiple page.

--
Gerbrand van Dieijen



All times are GMT. The time now is 09:39 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57