ITEXT PDF / CATATAN</>↗iText PDF28 Des 2011
You can use the Chunk‘s setUnderline(float thickness, float yPosition) method to add underline or strike through to a chunk. A negative value to the yPosition create an underline while a positive value will produce a strike through. package org.kodejava.itextpdf; import com.itextpdf.text.Chunk; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileNotFoundException; import java.io.FileOutputSt...
ITEXT PDF / CATATAN</>↗iText PDF28 Des 2011
We can set font style for text object such as Chunk, Phrase, Paragraph, etc. using the com.itextpdf.text.Font class. We can define the font face, size, style and its color using this class. package org.kodejava.itextpdf; import com.itextpdf.text.*; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class FontDemo { public static void main(String[] args) { Document doc = […]
ITEXT PDF / CATATAN</>↗iText PDF27 Des 2011
You can rotate images in the iText pdf document using the setRotation(final float r) or the setRotationDegrees(final float deg) methods of the com.itextpdf.text.Image class. This method sets the rotation in radian and in degree respectively. Let’s see an example below: package org.kodejava.itextpdf; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Image; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileOutputStr...
ITEXT PDF / CATATAN</>↗iText PDF27 Des 2011
The com.itextpdf.text.Image class represent an image of a graphic element such as JPEG, PNG or GIF that can be inserted into a PDF document. There are some methods of the com.itextpdf.text.Image class that can be used to scale the image. These methods include the following: scaleAbsolute(), scaleAbsoluteHeight(), scaleAbsoluteWidth(), scalePercent() and scaleToFit(). These are signatures of […]
ITEXT PDF / CATATAN</>↗iText PDF27 Des 2011
To set the absolute position of an image you can use the setAbsolutePosition() method. This method takes two parameters the X and Y coordinate where the image will be placed. In the pdf document the 0, 0 coordinate is located at the left bottom corner of the document. Let’s see an example below: package org.kodejava.itextpdf; […]
ITEXT PDF / CATATAN</>↗iText PDF26 Des 2011
The following example demonstrates how to add an image into a PDF document using the iText library. An image is created using the com.itextpdf.text.Image class. To create an instance of image, we can use the Image.getInstance() method. In the example below, we create an image from an image file name a URL that points to […]