⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pdfimageset.java

📁 Java生成PDF Java生成PDF Java生成PDF
💻 JAVA
字号:
// $Id: PDFImageSet.java,v 1.5 2003/11/04 17:16:01 mike Exp $package org.faceless.pdf;import java.io.*;/** * <p> * The <code>PDFImageSet</code> class is a thin wrapper around a multi-page * image format (currently only TIFF images). Although it can be used with * single page images, it's simpler just to create a {@link PDFImage} directly. * </p> * * <b>Example</b> * <pre> *   PDFImageSet tiff = new PDFImageSet(new FileInputStream("multipage.tif")); *   PDFImage page1 = tiff.getImage(1); *   PDFImage page2 = tiff.getImage(2); * </pre> * * @version $Revision: 1.5 $ * @since 1.1.13 * @see PDFImage */public class PDFImageSet{    private final org.faceless.pdf2.PDFImageSet set;        /**     * Create a new <code>PDFImageSet</code> from the specified InputStream.     * The stream must contain a recognized Image format - see the {@link PDFImage}     * class for a list of formats and restrictions     * @throws IOException if the image cannot be loaded or the format cannot be parsed     * @throws IllegalArgumentException if the image cannot be parsed     */    public PDFImageSet(InputStream in)        throws IOException, IllegalArgumentException    {	set = new org.faceless.pdf2.PDFImageSet(in);    }    /**     * Return the number of sub images, or "pages" in this image set.     * For all formats but TIFF this will return 1.     * @return the number of pages in this image     */    public int getNumImages()    {	return set.getNumImages();    }    /**     * Return the specified sub-image from this image as a {@link PDFImage}.     * If the requested page is out of range this method throws an     * <code>ArrayIndexOutOfBoundsException</code>. If the specified subimage     * is corrupt or cannot be parsed, throws an <code>IOException</code>     *     * @param page the page number, from 0 to {@link #getNumImages}     * @throws IOException if the TIFF file is corrupt or the image cannot be used     * @throws ArrayIndexOutOfBoundsException     */    public PDFImage getImage(int page)        throws IOException    {	return (PDFImage)PeeredObject.getPeer(set.getImage(page));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -