com.cete.dynamicpdf.pageelements
Class Label


Example: The following example will display text in a label 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 the string and label
           String text = "This is the dark blue, centered text at a 15 degree"+ 
           "angle contained in the label.";
           Label label = new Label(text, 0, 0, 512, 14, Font.getHelvetica(), 
           14, TextAlign.CENTER, RgbColor.getDarkBlue());
 
           // Change the angle property
           label.setAngle(15);
 
           // Add the label to the page
           page.getElements().add(label);    
 
           // Save the PDF
           document.draw("[physicalpath]/MyDocument.pdf" );
       }
 }