com.cete.dynamicpdf.pageelements
Class Rectangle


Example: The following example will display a custom rectangle on the page.

import com.cete.dynamicpdf.*;
 import com.cete.dynamicpdf.pageelements.*;
 
 public class MyClass{
       public static void main(String args[]){
 
           // Create a PDF Document
           Document document = new Document();
 
           // Create a Page and add it to the document
           Page page = new Page();
           document.getPages().add(page);
 
           // Create a rectangle
           Rectangle rectangle = new Rectangle( 50, 50, 200,
           200, Grayscale.getBlack(), RgbColor.getGray(), 4,
           LineStyle.getSolid());
 
           // Change the corner radius property
           rectangle.setCornerRadius(10);
 
           // Add the rectangle to the page
           page.getElements().add(rectangle);
 
           // Save the PDF
           document.draw("[Physicalpath]/MyDocument.pdf");
       }
 }