Skip to main content

Printing the browser component's contents

3 replies [Last post]
palndron
Offline
Joined: 2005-04-04

Hi all,

When I try to print the browser's contents, all I get is emptyness.

I have modified the browser sample to add a print button, and it really doesn't work.

Is what am I doing incorrect, or is this a known issue?
this is the print code...

public int print(Graphics g, PageFormat pf, int pi)
throws PrinterException {
if (pi >= 1) {
return Printable.NO_SUCH_PAGE;
}
webBrowser.print((Graphics2D) g);
return Printable.PAGE_EXISTS;
}

Message was edited by: palndron

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
palndron
Offline
Joined: 2005-04-04

This code does give us a nice gray box though...

public int print(Graphics g, PageFormat pf, int pi)
throws PrinterException {
if (pi >= 1) {
return Printable.NO_SUCH_PAGE;
}
Component c = (Component)webBrowser;
c.paintAll(g);
return Printable.PAGE_EXISTS;
}

georgez
Offline
Joined: 2003-08-19

Hi,

Yes, "print" is not implemented for the Browser component yet. It would be done after we implement the DOM or execuring javascript features.

-George.

palndron
Offline
Joined: 2005-04-04

If this is not there yet ( just found the road map ) can you comment on the When and How?

If this component is inside of a panel lets say, will we be able to print just the viewable portion of the component (as an option?).