imhotep_zr7s
Messages postés8Date d'inscriptionmercredi 24 septembre 2003StatutMembreDernière intervention 7 février 2006
-
24 sept. 2003 à 10:15
assimFab
Messages postés2Date d'inscriptionmardi 28 décembre 2010StatutMembreDernière intervention14 mai 2012
-
14 mai 2012 à 14:10
Bonjour,
Je suis à la recherche d'un moyen pour imprimer en ligne de commande des documents word.
J'ai récupéré des sources pour lancer des impressions, mais aucune source ne permet de lancer l'impression sans boîte de dialogue.
Cela est-il possible et comment ?
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
{
int retValue = Printable.NO_SUCH_PAGE;
if (pageIndex == 0){
Graphics2D g2d = (Graphics2D)graphics;
// Device
String text = "Taille du device : " + g2d.getDeviceConfiguration().getBounds().toString();
graphics.drawString(text, (int)(pageFormat.getImageableX()), (int)
(pageFormat.getImageableY()+pageFormat.getImageableHeight()/3.0));
// clipping
text = "Taille du clipping : " + g2d.getClipBounds().toString();
graphics.drawString(text, (int)(pageFormat.getImageableX()), (int)
(pageFormat.getImageableY()+pageFormat.getImageableHeight()/2.0));
// imageable
Rectangle rect = new Rectangle((int)pageFormat.getImageableX(),
(int)pageFormat.getImageableY(),
(int)pageFormat.getImageableWidth(),
(int)pageFormat.getImageableHeight());
text = "Taille de l'imageable : " + rect.toString();
graphics.drawString(text, (int)(pageFormat.getImageableX()), (int)
(pageFormat.getImageableY()+2.0*pageFormat.getImageableHeight()/3.0));
retValue = PAGE_EXISTS;
}
return retValue;
}
}
,ça fait des jours que je cherche de l'aide mais sans resultat.Il suffit de le copier et ensuite coller et enlever le package.
Quelqu'un peut-il m'aider à imprimer tous ces composants dans une seule page?
SVP,aidez-moi.