1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public int print( Graphics sp_g,
PageFormat sp_pageformat,
int sp_pageidx)
throws PrinterException
{
Graphics2D w_g2 = (Graphics2D) sp_g;
if ( ........ ) {
// Mon code de mise en page et de découpage ...
} else {
BufferedImage test = w_g2.getDeviceConfiguration().createCompatibleImage( (int)sp_pageformat.getWidth(), (int)sp_pageformat.getHeight() );
jvobj000.i_jvcde010.fr_impr.sp_set_image( test );
//DEBUG
try {
File tt = new File("Test" + w_page + ".png");
ImageIO.write( test, "png", tt );
}catch(Exception e) {}
return NO_SUCH_PAGE;
}
} |