com.cete.dynamicpdf.pageelements
Class Line


Example: The following example will display two different lines 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 line
           Line line = new Line(50, 50, 50, 400, 5, Grayscale.getBlack(), 
           LineStyle.getSolid());
 
           // Change the line cap property
           line.setCap(LineCap.ROUND);
 
           // Add two lines to the page
           page.getElements().add(line);    
           page.getElements().add(new Line( 60, 50, 150, 400, 2, 
           RgbColor.getBlue(), LineStyle.getDashLarge()));
 
           // Save the PDF
           document.draw("[Physicalpath]/MyDocument.pdf");
       }
 }