import java.io.FileOutputStream;
import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;
public class FillCirclesPDF {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("FillCirclesPDF.pdf"));
document.open();
PdfContentByte cb = 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.fillStroke();
} catch (Exception e) {
System.err.println(e.getMessage());
}
document.close();
}
}
|