Generate a PDF document using Java (2)

zhaozj2021-02-16  46

Edit form

The table in ITEXT is very similar to the use of the table in HTML. However, it has a cell represents a lattice. Basically, the Table object in Table and Swing is consistent, such as the table in the top of the table:

/ / Define a form

Table Table = New Table (2);

/ / Set the table border

Table.setBorderwidth (1);

Cell Cell = New Cell ("Matrix III");

Cell.SetHeader (TRUE);

//categorize

Cell.SetColspan (2);

Cell.SetBackgroundColor (color.blue);

Table.Addcell (Cell);

Place a picture

Now you must know how to add a picture to the document, oleep as long as you declare an Image object, the image of Image and AWT is the same.

// Define a picture

Image jpeg = image.getInstance ("c: /matrix.jpg");

// Picture

JPEG.SETALIGNMENT (image.align_center);

End

I will introduce these, and more in-depth things have experienced by the use of ITEXT.

转载请注明原文地址:https://www.9cbs.com/read-22600.html

New Post(0)