railo.runtime.text.pdf
Class PDFUtil

java.lang.Object
  extended by railo.runtime.text.pdf.PDFUtil

public class PDFUtil
extends Object


Field Summary
static int ENCRYPT_AES_128
           
static int ENCRYPT_NONE
           
static int ENCRYPT_RC4_128
           
static int ENCRYPT_RC4_128M
           
static int ENCRYPT_RC4_40
           
 
Constructor Summary
PDFUtil()
           
 
Method Summary
static void concat(PDFDocument[] docs, OutputStream os, boolean keepBookmark, boolean removePages, boolean stopOnError, char version)
           
static void encrypt(PDFDocument doc, OutputStream os, String newUserPassword, String newOwnerPassword, int permissions, int encryption)
           
static Object extractText(PDFDocument doc, Set<Integer> pageNumbers)
           
static HashMap generateGoToBookMark(String title, int page)
           
static HashMap generateGoToBookMark(String title, int page, int x, int y)
           
static void parsePageDefinition(Set<Integer> pages, String strPages)
           
static Set parsePageDefinition(String strPages)
           
static void setChildBookmarks(Map parent, List children)
           
static Image toImage(byte[] input, int page)
           
static com.lowagie.text.pdf.PdfReader toPdfReader(Object value, String password)
           
static int toPermission(String strPermission)
          convert a string defintion of a permision in a integer Constant (PdfWriter.ALLOW_XXX)
static int toPermissions(String strPermissions)
          convert a string list of permission
static void writeImages(byte[] input, Set pages, Resource outputDirectory, String prefix, String format, int scale, boolean overwrite, boolean goodQuality, boolean transparent)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCRYPT_RC4_40

public static final int ENCRYPT_RC4_40
See Also:
Constant Field Values

ENCRYPT_RC4_128

public static final int ENCRYPT_RC4_128
See Also:
Constant Field Values

ENCRYPT_RC4_128M

public static final int ENCRYPT_RC4_128M
See Also:
Constant Field Values

ENCRYPT_AES_128

public static final int ENCRYPT_AES_128
See Also:
Constant Field Values

ENCRYPT_NONE

public static final int ENCRYPT_NONE
See Also:
Constant Field Values
Constructor Detail

PDFUtil

public PDFUtil()
Method Detail

toPermissions

public static int toPermissions(String strPermissions)
                         throws PageException
convert a string list of permission

Parameters:
strPermissions -
Returns:
Throws:
PageException

toPermission

public static int toPermission(String strPermission)
                        throws ApplicationException
convert a string defintion of a permision in a integer Constant (PdfWriter.ALLOW_XXX)

Parameters:
strPermission -
Returns:
Throws:
ApplicationException

concat

public static void concat(PDFDocument[] docs,
                          OutputStream os,
                          boolean keepBookmark,
                          boolean removePages,
                          boolean stopOnError,
                          char version)
                   throws PageException,
                          IOException,
                          com.lowagie.text.DocumentException
Parameters:
docs -
os -
removePages - if true, pages defined in PDFDocument will be removed, otherwise all other pages will be removed
version -
Throws:
PageException
IOException
com.lowagie.text.DocumentException

parsePageDefinition

public static Set parsePageDefinition(String strPages)
                               throws PageException
Throws:
PageException

parsePageDefinition

public static void parsePageDefinition(Set<Integer> pages,
                                       String strPages)
                                throws PageException
Throws:
PageException

encrypt

public static void encrypt(PDFDocument doc,
                           OutputStream os,
                           String newUserPassword,
                           String newOwnerPassword,
                           int permissions,
                           int encryption)
                    throws ApplicationException,
                           com.lowagie.text.DocumentException,
                           IOException
Throws:
ApplicationException
com.lowagie.text.DocumentException
IOException

generateGoToBookMark

public static HashMap generateGoToBookMark(String title,
                                           int page)

generateGoToBookMark

public static HashMap generateGoToBookMark(String title,
                                           int page,
                                           int x,
                                           int y)

setChildBookmarks

public static void setChildBookmarks(Map parent,
                                     List children)

toPdfReader

public static com.lowagie.text.pdf.PdfReader toPdfReader(Object value,
                                                         String password)
                                                  throws IOException,
                                                         PageException
Throws:
IOException
PageException

toImage

public static Image toImage(byte[] input,
                            int page)
                     throws PageException,
                            IOException
Throws:
PageException
IOException

writeImages

public static void writeImages(byte[] input,
                               Set pages,
                               Resource outputDirectory,
                               String prefix,
                               String format,
                               int scale,
                               boolean overwrite,
                               boolean goodQuality,
                               boolean transparent)
                        throws PageException,
                               IOException
Throws:
PageException
IOException

extractText

public static Object extractText(PDFDocument doc,
                                 Set<Integer> pageNumbers)
                          throws IOException,
                                 org.pdfbox.exceptions.CryptographyException,
                                 org.pdfbox.exceptions.InvalidPasswordException
Throws:
IOException
org.pdfbox.exceptions.CryptographyException
org.pdfbox.exceptions.InvalidPasswordException


Copyright © 2012 Railo