Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset
Comments Off

Java PDF: Dessiner un cercle sans bordure

Java PDF:  Dessiner un cercle sans bordure
Download

/***** Code de MesExemples.com *******/
/**
 * @(#)ExempleFillCirclesPDF.java
 *
 *
 * @author 
 *sakoba(java.mesexemples.com) @version 1.00 2013/4/26
 */
 
 
 
import java.io.FileOutputStream;
 
import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfWriter;
 
public class ExempleFillCirclesSansBorderPDF {
  public static void main(String[] args) {
    Document document = new Document();
 
    try {
      PdfWriter pdf_writer = PdfWriter.getInstance(document, 
      	new FileOutputStream("c:/ExFillCirclesSBPDF.pdf"));
      document.open();
 
      PdfContentByte cb = pdf_writer.getDirectContent();
 
      cb.setRGBColorFill(0xFF, 0x00, 0x00);
      cb.circle(250.0f, 500.0f, 200.0f);
      cb.circle(250.0f, 500.0f, 150.0f);
      cb.circle(350.0f, 300.0f, 150.0f);
 
      cb.fill();
 
 
    } catch (Exception err) {
      System.err.println(err.getMessage());
    }
    document.close();
  }
}
----------------------------------------------------------------------------
Close
Réseaux Sociaux
Nous rejoindre sur les réseaux Sociaux