com.cete.dynamicpdf.pageelements
Class Path


Example: The following example will display a path that incorporates several different subpaths before retuning to its starting location.

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 path
           Path path = new Path(50, 150, RgbColor.getBlue(), RgbColor.getYellow(),  
           3, LineStyle.getSolid(), true);
 
           // Add some sub paths to the path
           path.getSubPaths().add(new CurveSubPath(50, 400, 300, 150, -200, 400));
           path.getSubPaths().add(new LineSubPath(300, 400));
           path.getSubPaths().add(new CurveToSubPath(300, 150, 50, 300));
           path.getSubPaths().add(new CurveFromSubPath(150, 100, 200, -100));
 
           // Add the path to the page
           page.getElements().add(path);  
 
           // Save the PDF
           document.draw("[PhysicalPath]/MyDocument.pdf" );
       }
 }