public void drawToImage ( String path ) { try { ImageOutputDisplay disp = new ImageOutputDisplay ( getPage ( ) . getWidth ( ) , getPage ( ) . getHeight ( ) ) ; disp . drawPage ( getPage ( ) ) ; disp . saveTo ( path ) ; } catch ( IOException e ) { log . error ( "Couldn't write to " + path + ": " + e . getMessage ( ) ) ; } }
Draws the current page to an image file .