Java Code Examples for com.lowagie.text.Image#CX

The following examples show how to use com.lowagie.text.Image#CX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PdfContentByte.java    From gcs with Mozilla Public License 2.0 5 votes vote down vote up
/**
 * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have absolute
 * positioning. The image can be placed inline.
 * 
 * @param image the <CODE>Image</CODE> object
 * @param inlineImage <CODE>true</CODE> to place this image inline, <CODE>false</CODE> otherwise
 * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning
 */
public void addImage(Image image, boolean inlineImage) throws DocumentException {
	if (!image.hasAbsoluteY()) {
		throw new DocumentException("The image must have absolute positioning.");
	}
	float matrix[] = image.matrix();
	matrix[Image.CX] = image.getAbsoluteX() - matrix[Image.CX];
	matrix[Image.CY] = image.getAbsoluteY() - matrix[Image.CY];
	addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], inlineImage);
}
 
Example 2
Source File: PdfContentByte.java    From itext2 with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have
 * absolute positioning. The image can be placed inline.
 * @param image the <CODE>Image</CODE> object
 * @param inlineImage <CODE>true</CODE> to place this image inline, <CODE>false</CODE> otherwise
 * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning
 */
public void addImage(Image image, boolean inlineImage) throws DocumentException {
    if (!image.hasAbsoluteY())
        throw new DocumentException("The image must have absolute positioning.");
    float matrix[] = image.matrix();
    matrix[Image.CX] = image.getAbsoluteX() - matrix[Image.CX];
    matrix[Image.CY] = image.getAbsoluteY() - matrix[Image.CY];
    addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], inlineImage);
}
 
Example 3
Source File: PdfContentByte.java    From MesquiteCore with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have
 * absolute positioning.
 * @param image the <CODE>Image</CODE> object
 * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning
 */
public void addImage(Image image) throws DocumentException {
    if (!image.hasAbsolutePosition())
        throw new DocumentException("The image must have absolute positioning.");
    float matrix[] = image.matrix();
    matrix[Image.CX] = image.absoluteX() - matrix[Image.CX];
    matrix[Image.CY] = image.absoluteY() - matrix[Image.CY];
    addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
}