Java Code Examples for com.lowagie.text.Image#setUrl()

The following examples show how to use com.lowagie.text.Image#setUrl() . 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: BmpImage.java    From gcs with Mozilla Public License 2.0 5 votes vote down vote up
/**
 * Reads a BMP from an url.
 * 
 * @param url the url
 * @throws IOException on error
 * @return the image
 */
public static Image getImage(URL url) throws IOException {
	InputStream is = null;
	try {
		is = url.openStream();
		Image img = getImage(is);
		img.setUrl(url);
		return img;
	} finally {
		if (is != null) {
			is.close();
		}
	}
}
 
Example 2
Source File: PngImage.java    From gcs with Mozilla Public License 2.0 5 votes vote down vote up
/** Reads a PNG from an url.
 * @param url the url
 * @throws IOException on error
 * @return the image
 */    
public static Image getImage(URL url) throws IOException {
    InputStream is = null;
    try {
        is = url.openStream();
        Image img = getImage(is);
        img.setUrl(url);
        return img;
    }
    finally {
        if (is != null) {
            is.close();
        }
    }
}
 
Example 3
Source File: BmpImage.java    From itext2 with GNU Lesser General Public License v3.0 5 votes vote down vote up
/** Reads a BMP from an url.
 * @param url the url
 * @throws IOException on error
 * @return the image
 */    
public static Image getImage(URL url) throws IOException {
    InputStream is = null;
    try {
        is = url.openStream();
        Image img = getImage(is);
        img.setUrl(url);
        return img;
    }
    finally {
        if (is != null) {
            is.close();
        }
    }
}
 
Example 4
Source File: PngImage.java    From itext2 with GNU Lesser General Public License v3.0 5 votes vote down vote up
/** Reads a PNG from an url.
 * @param url the url
 * @throws IOException on error
 * @return the image
 */    
public static Image getImage(URL url) throws IOException {
    InputStream is = null;
    try {
        is = url.openStream();
        Image img = getImage(is);
        img.setUrl(url);
        return img;
    }
    finally {
        if (is != null) {
            is.close();
        }
    }
}
 
Example 5
Source File: PngImage.java    From MesquiteCore with GNU Lesser General Public License v3.0 5 votes vote down vote up
/** Reads a PNG from an url.
 * @param url the url
 * @throws IOException on error
 * @return the image
 */    
public static Image getImage(URL url) throws IOException {
    InputStream is = null;
    try {
        is = url.openStream();
        Image img = getImage(is);
        img.setUrl(url);
        return img;
    }
    finally {
        if (is != null) {
            is.close();
        }
    }
}