X, Y coordinates : Coordinate « PDF RTF « Java






X, Y coordinates

X, Y coordinates
import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfTemplate;
import com.lowagie.text.pdf.PdfWriter;

public class XandYcoordinatesPdfContentByte {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("XandYcoordinatesPdfContentByte.pdf"));
      document.open();
      PdfContentByte cb = writer.getDirectContent();

      cb.moveTo(216, 720);
      cb.lineTo(360, 360);
      cb.lineTo(360, 504);
      cb.lineTo(72, 144);
      cb.lineTo(144, 288);
      cb.stroke();

    } catch (Exception e) {
      System.err.println(e.getMessage());
    }
    document.close();
  }
}
           
       








itext.zip( 1,748 k)

Related examples in the same category

1.X, Y coordinates: PdfContentByte TextX, Y coordinates: PdfContentByte Text
2.Coordinate UpsideDownCoordinate UpsideDown