com.cete.dynamicpdf.pageelements
Class Image


Example: The following example will place an image on the page and then set the Y scale to twice as much as the X scale.

 import com.cete.dynamicpdf.*;
 import com.cete.dynamicpdf.pageelements.*;
 import java.io.FileNotFoundException;
  
 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);
           
		   Image image = null;

           // Create an image
		   try{
				image = new Image("[physicalpath]/MyImage.jpg", 0, 0);
			}catch(FileNotFoundException ex){
				System.out.println("File does not exist");
			}

           // Add the image to the page
           page.getElements().add(image);  
 
           // Save the PDF
           document.draw("[physicalpath]/MyDocument.pdf");
       }
 }