EasyPDF Java SDK
v5.1

com.bcl.easypdf.EasyPDFProcessor
Class IPDFProcessor

java.lang.Object
  extended by com.bcl.easypdf.EasyPDFProcessor.IPDFProcessor

public class IPDFProcessor
extends java.lang.Object

To do post-processing of existing PDF files, create an object of this class.


Constructor Summary
IPDFProcessor()
          Default constructor.
 
Method Summary
 void AddAttachment(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, java.lang.String Attachment, java.lang.String Author, java.lang.String Subject, java.lang.String Description, int EprcAttachIcon, int Color)
          Adds an attachment to a PDF file.
 void AddDateTimeTextForPrint(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.String JSStream, double Left, double Top, double Right, double Bottom, java.lang.String FieldName)
           
 void AddFreeText(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, java.lang.String Text, java.lang.String Author, java.lang.String Subject, double Size, int EprcDefaultFont, int Color)
          Adds text to a PDF file.
 void AddHyperlink(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, double Right, double Bottom, java.lang.String Url, int EprcAnnotBorderStyle, int Color)
          Adds a hyperlink to pages in the range [From, To] of a PDF file.
 void AddNote(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, java.lang.String Text, java.lang.String Author, java.lang.String Subject, int EprcNoteIcon, int Color, boolean Opened)
          Adds a note to the pages ([From, To]) of a PDF file.
 void AddPDFText(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, java.lang.String Text, double Size, int EprcDefaultFont, int Color)
          Adds text to a PDF file.
 void AddRubberStamp(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, double Right, double Bottom, java.lang.String Text, java.lang.String Author, java.lang.String Subject, int EprcStampIcon, int Color)
           
 void AddSquareCircle(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, double Left, double Top, double Right, double Bottom, double BorderWidth, java.lang.String Text, java.lang.String Author, java.lang.String Subject, boolean IsSquare, int FillColor, int BorderColor, int Opacity)
          Adds a square or circle annotation to a PDF file.
 void AddStamp(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.String InputImageFileName, boolean FirstPageOnly, int EprnStampHPosition, int EprnStampVPosition, int EprnStampZOrder, double hoffset, double voffset, int color, int zoom)
           
 void AddWatermark(java.lang.String InputFileName, java.lang.String OutputFileName, int EprnWmarkHPosition, int EprnWmarkVPosition, int EprnWmarkZOrder, int EprnWmarkAlignment, double hoffset, double voffset, boolean bfirstpageonly, java.lang.String font, int fontsize, int embeds, int angle, int color, int opacity, boolean boutlineonly, java.lang.String text)
           
 void Decrypt(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.String Password)
          Decrypts an encrypted PDF file.
 void DeleteAllBookmarks(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.Object Password)
          Deletes all bookmarks from a PDF file.
 void DeletePages(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To)
          Deletes one or more pages in the range [From, To] from the input PDF file.
 void Encrypt(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.String UserPassword, java.lang.String OwnerPassword, int EprcSecEncryption, int EprcSecAnnotationPerm, int EprcSecExtractionPerm, int EprcSecModificationPerm, int EprcSecPrintingPerm)
          Encrypt a PDF file.
 void ExtractPages(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To)
          Extacts the specified pages ([From, To]) from a PDF file.
 void ExtractText(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.Object Password, java.lang.Object From, java.lang.Object To, java.lang.Object PageSeparator, java.lang.Object CodePage)
          Extracts text from a PDF file.
 java.lang.String ExtractText2(java.lang.String InputFileName, int Page, double Left, double Top, double Right, double Bottom, java.lang.Object Password)
          Extracts text from the specified area of a given page in a PDF file.
 void GetDocumentInfo(java.lang.String InputFileName, java.lang.Object Password, org.jawin.Variant.ByrefHolder Title, org.jawin.Variant.ByrefHolder Author, org.jawin.Variant.ByrefHolder Subject, org.jawin.Variant.ByrefHolder Keywords, org.jawin.Variant.ByrefHolder Creator, org.jawin.Variant.ByrefHolder Producer)
          Retrieves document information from a PDF file.
 int getLibraryVersionMajor()
           
 int getLibraryVersionMinor()
           
 boolean getOptimizeAfterEachProcess()
          Returns a boolean value indicating whether to optimize the PDF file after each process.
 int GetPageCount(java.lang.String InputFileName, java.lang.Object Password)
          Returns the number of pages in an encrypted PDF file.
 int GetPageRotation(java.lang.String InputFileName, int Page)
          Returns page rotation information about a given page in a PDF file.
 void GetPageSize(java.lang.String InputFileName, int Page, org.jawin.Variant.ByrefHolder Width, org.jawin.Variant.ByrefHolder Height)
          Retrieves the size (width x height) of a given page in a PDF file.
 void GetVersionNumber(java.lang.String InputFileName, org.jawin.Variant.ByrefHolder VersionMajor, org.jawin.Variant.ByrefHolder VersionMinor)
          Gets the major and minor version numbers from a PDF file.
 boolean HasPassword(java.lang.String InputFileName)
          Checks if a PDF file has a password.
 boolean HasUserPassword(java.lang.String InputFileName)
          Checks if a PDF file has a user password.
 void Initialize(java.lang.Object Init)
          This is a deprecated method.
 boolean IsEncrypted(java.lang.String InputFileName)
          Checks if a PDF file is encrypted.
 void Linearize(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.Object Password)
           
 void Merge(java.lang.String InputFileName1, java.lang.String InputFileName2, java.lang.String OutputFileName)
          Merges two PDF files into one.
 void Optimize(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.Object Password)
          Reduces the size of an encrypted PDF file.
 void PrintToPhysicalPrinter(java.lang.String InputFileName, java.lang.String PhysicalPrinterName, int From, int To, int NumberOfCopies, boolean WholeDocument)
           
 void RotatePages(java.lang.String InputFileName, java.lang.String OutputFileName, int From, int To, int EprcPageRotation)
          Rotates one or more pages ([From, To]) from a PDF file.
 void SetDocumentInfo(java.lang.String InputFileName, java.lang.String OutputFileName, java.lang.Object Title, java.lang.Object Author, java.lang.Object Subject, java.lang.Object Keywords, java.lang.Object Creator)
          Sets document information about a PDF file.
 void setLicenseKey(java.lang.String newVal)
          This is a deprecated method.
 void setOptimizeAfterEachProcess(boolean newVal)
          To optimize the PDF file after each process, call this method with true.
 void Split(java.lang.String InputFileName, java.lang.String OutputFileName1, java.lang.String OutputFileName2, int PageNumber)
          Splits one PDF file into two.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPDFProcessor

public IPDFProcessor()
              throws EasyPDFException
Default constructor.

Throws:
EasyPDFException
Method Detail

setLicenseKey

public void setLicenseKey(java.lang.String newVal)
                   throws EasyPDFException
This is a deprecated method.

Throws:
EasyPDFException

Initialize

public void Initialize(java.lang.Object Init)
                throws EasyPDFException
This is a deprecated method.

Throws:
EasyPDFException

getLibraryVersionMajor

public int getLibraryVersionMajor()
                           throws EasyPDFException
Throws:
EasyPDFException

getLibraryVersionMinor

public int getLibraryVersionMinor()
                           throws EasyPDFException
Throws:
EasyPDFException

Merge

public void Merge(java.lang.String InputFileName1,
                  java.lang.String InputFileName2,
                  java.lang.String OutputFileName)
           throws EasyPDFException
Merges two PDF files into one.

Throws:
EasyPDFException

Split

public void Split(java.lang.String InputFileName,
                  java.lang.String OutputFileName1,
                  java.lang.String OutputFileName2,
                  int PageNumber)
           throws EasyPDFException
Splits one PDF file into two.

Parameters:
InputFileName - file name of the PDF to be splitted
OutputFileName1 - first output PDF file name
OutputFileName2 - second output PDF file name
PageNumber - pages starting from this page number till the end of the input file will be splitted into OutputFileName2
Throws:
EasyPDFException

DeletePages

public void DeletePages(java.lang.String InputFileName,
                        java.lang.String OutputFileName,
                        int From,
                        int To)
                 throws EasyPDFException
Deletes one or more pages in the range [From, To] from the input PDF file.

Throws:
EasyPDFException

RotatePages

public void RotatePages(java.lang.String InputFileName,
                        java.lang.String OutputFileName,
                        int From,
                        int To,
                        int EprcPageRotation)
                 throws EasyPDFException
Rotates one or more pages ([From, To]) from a PDF file.

Parameters:
InputFileName - file name of input PDF file
OutputFileName - output PDF file name
From - start page
To - end page
EprcPageRotation - page rotation setting defined in prcPageRotation
Throws:
EasyPDFException
See Also:
prcPageRotation

Optimize

public void Optimize(java.lang.String InputFileName,
                     java.lang.String OutputFileName,
                     java.lang.Object Password)
              throws EasyPDFException
Reduces the size of an encrypted PDF file.

Throws:
EasyPDFException

GetVersionNumber

public void GetVersionNumber(java.lang.String InputFileName,
                             org.jawin.Variant.ByrefHolder VersionMajor,
                             org.jawin.Variant.ByrefHolder VersionMinor)
                      throws EasyPDFException
Gets the major and minor version numbers from a PDF file.

Throws:
EasyPDFException

IsEncrypted

public boolean IsEncrypted(java.lang.String InputFileName)
                    throws EasyPDFException
Checks if a PDF file is encrypted.

Throws:
EasyPDFException

HasUserPassword

public boolean HasUserPassword(java.lang.String InputFileName)
                        throws EasyPDFException
Checks if a PDF file has a user password.

Throws:
EasyPDFException

HasPassword

public boolean HasPassword(java.lang.String InputFileName)
                    throws EasyPDFException
Checks if a PDF file has a password.

Throws:
EasyPDFException

GetPageCount

public int GetPageCount(java.lang.String InputFileName,
                        java.lang.Object Password)
                 throws EasyPDFException
Returns the number of pages in an encrypted PDF file.

Throws:
EasyPDFException

GetDocumentInfo

public void GetDocumentInfo(java.lang.String InputFileName,
                            java.lang.Object Password,
                            org.jawin.Variant.ByrefHolder Title,
                            org.jawin.Variant.ByrefHolder Author,
                            org.jawin.Variant.ByrefHolder Subject,
                            org.jawin.Variant.ByrefHolder Keywords,
                            org.jawin.Variant.ByrefHolder Creator,
                            org.jawin.Variant.ByrefHolder Producer)
                     throws EasyPDFException
Retrieves document information from a PDF file.

Throws:
EasyPDFException

SetDocumentInfo

public void SetDocumentInfo(java.lang.String InputFileName,
                            java.lang.String OutputFileName,
                            java.lang.Object Title,
                            java.lang.Object Author,
                            java.lang.Object Subject,
                            java.lang.Object Keywords,
                            java.lang.Object Creator)
                     throws EasyPDFException
Sets document information about a PDF file.

Throws:
EasyPDFException

Encrypt

public void Encrypt(java.lang.String InputFileName,
                    java.lang.String OutputFileName,
                    java.lang.String UserPassword,
                    java.lang.String OwnerPassword,
                    int EprcSecEncryption,
                    int EprcSecAnnotationPerm,
                    int EprcSecExtractionPerm,
                    int EprcSecModificationPerm,
                    int EprcSecPrintingPerm)
             throws EasyPDFException
Encrypt a PDF file.

Throws:
EasyPDFException
See Also:
prcSecEncryption, prcSecAnnotationPerm, prcSecExtractionPerm, prcSecModificationPerm, prcSecPrintingPerm

Decrypt

public void Decrypt(java.lang.String InputFileName,
                    java.lang.String OutputFileName,
                    java.lang.String Password)
             throws EasyPDFException
Decrypts an encrypted PDF file.

Throws:
EasyPDFException

ExtractText

public void ExtractText(java.lang.String InputFileName,
                        java.lang.String OutputFileName,
                        java.lang.Object Password,
                        java.lang.Object From,
                        java.lang.Object To,
                        java.lang.Object PageSeparator,
                        java.lang.Object CodePage)
                 throws EasyPDFException
Extracts text from a PDF file.

Throws:
EasyPDFException

GetPageRotation

public int GetPageRotation(java.lang.String InputFileName,
                           int Page)
                    throws EasyPDFException
Returns page rotation information about a given page in a PDF file.

Throws:
EasyPDFException

GetPageSize

public void GetPageSize(java.lang.String InputFileName,
                        int Page,
                        org.jawin.Variant.ByrefHolder Width,
                        org.jawin.Variant.ByrefHolder Height)
                 throws EasyPDFException
Retrieves the size (width x height) of a given page in a PDF file.

Throws:
EasyPDFException

AddHyperlink

public void AddHyperlink(java.lang.String InputFileName,
                         java.lang.String OutputFileName,
                         int From,
                         int To,
                         double Left,
                         double Top,
                         double Right,
                         double Bottom,
                         java.lang.String Url,
                         int EprcAnnotBorderStyle,
                         int Color)
                  throws EasyPDFException
Adds a hyperlink to pages in the range [From, To] of a PDF file.

Throws:
EasyPDFException

AddNote

public void AddNote(java.lang.String InputFileName,
                    java.lang.String OutputFileName,
                    int From,
                    int To,
                    double Left,
                    double Top,
                    java.lang.String Text,
                    java.lang.String Author,
                    java.lang.String Subject,
                    int EprcNoteIcon,
                    int Color,
                    boolean Opened)
             throws EasyPDFException
Adds a note to the pages ([From, To]) of a PDF file.

Throws:
EasyPDFException

AddAttachment

public void AddAttachment(java.lang.String InputFileName,
                          java.lang.String OutputFileName,
                          int From,
                          int To,
                          double Left,
                          double Top,
                          java.lang.String Attachment,
                          java.lang.String Author,
                          java.lang.String Subject,
                          java.lang.String Description,
                          int EprcAttachIcon,
                          int Color)
                   throws EasyPDFException
Adds an attachment to a PDF file.

Throws:
EasyPDFException

AddRubberStamp

public void AddRubberStamp(java.lang.String InputFileName,
                           java.lang.String OutputFileName,
                           int From,
                           int To,
                           double Left,
                           double Top,
                           double Right,
                           double Bottom,
                           java.lang.String Text,
                           java.lang.String Author,
                           java.lang.String Subject,
                           int EprcStampIcon,
                           int Color)
                    throws EasyPDFException
Throws:
EasyPDFException

ExtractText2

public java.lang.String ExtractText2(java.lang.String InputFileName,
                                     int Page,
                                     double Left,
                                     double Top,
                                     double Right,
                                     double Bottom,
                                     java.lang.Object Password)
                              throws EasyPDFException
Extracts text from the specified area of a given page in a PDF file.

Throws:
EasyPDFException

ExtractPages

public void ExtractPages(java.lang.String InputFileName,
                         java.lang.String OutputFileName,
                         int From,
                         int To)
                  throws EasyPDFException
Extacts the specified pages ([From, To]) from a PDF file.

Throws:
EasyPDFException

AddFreeText

public void AddFreeText(java.lang.String InputFileName,
                        java.lang.String OutputFileName,
                        int From,
                        int To,
                        double Left,
                        double Top,
                        java.lang.String Text,
                        java.lang.String Author,
                        java.lang.String Subject,
                        double Size,
                        int EprcDefaultFont,
                        int Color)
                 throws EasyPDFException
Adds text to a PDF file.

Throws:
EasyPDFException

getOptimizeAfterEachProcess

public boolean getOptimizeAfterEachProcess()
                                    throws EasyPDFException
Returns a boolean value indicating whether to optimize the PDF file after each process.

Throws:
EasyPDFException

setOptimizeAfterEachProcess

public void setOptimizeAfterEachProcess(boolean newVal)
                                 throws EasyPDFException
To optimize the PDF file after each process, call this method with true.

Throws:
EasyPDFException

DeleteAllBookmarks

public void DeleteAllBookmarks(java.lang.String InputFileName,
                               java.lang.String OutputFileName,
                               java.lang.Object Password)
                        throws EasyPDFException
Deletes all bookmarks from a PDF file.

Throws:
EasyPDFException

AddPDFText

public void AddPDFText(java.lang.String InputFileName,
                       java.lang.String OutputFileName,
                       int From,
                       int To,
                       double Left,
                       double Top,
                       java.lang.String Text,
                       double Size,
                       int EprcDefaultFont,
                       int Color)
                throws EasyPDFException
Adds text to a PDF file.

Throws:
EasyPDFException

AddSquareCircle

public void AddSquareCircle(java.lang.String InputFileName,
                            java.lang.String OutputFileName,
                            int From,
                            int To,
                            double Left,
                            double Top,
                            double Right,
                            double Bottom,
                            double BorderWidth,
                            java.lang.String Text,
                            java.lang.String Author,
                            java.lang.String Subject,
                            boolean IsSquare,
                            int FillColor,
                            int BorderColor,
                            int Opacity)
                     throws EasyPDFException
Adds a square or circle annotation to a PDF file.

Throws:
EasyPDFException

Linearize

public void Linearize(java.lang.String InputFileName,
                      java.lang.String OutputFileName,
                      java.lang.Object Password)
               throws EasyPDFException
Throws:
EasyPDFException

AddDateTimeTextForPrint

public void AddDateTimeTextForPrint(java.lang.String InputFileName,
                                    java.lang.String OutputFileName,
                                    java.lang.String JSStream,
                                    double Left,
                                    double Top,
                                    double Right,
                                    double Bottom,
                                    java.lang.String FieldName)
                             throws EasyPDFException
Throws:
EasyPDFException

PrintToPhysicalPrinter

public void PrintToPhysicalPrinter(java.lang.String InputFileName,
                                   java.lang.String PhysicalPrinterName,
                                   int From,
                                   int To,
                                   int NumberOfCopies,
                                   boolean WholeDocument)
                            throws EasyPDFException
Throws:
EasyPDFException

AddStamp

public void AddStamp(java.lang.String InputFileName,
                     java.lang.String OutputFileName,
                     java.lang.String InputImageFileName,
                     boolean FirstPageOnly,
                     int EprnStampHPosition,
                     int EprnStampVPosition,
                     int EprnStampZOrder,
                     double hoffset,
                     double voffset,
                     int color,
                     int zoom)
              throws EasyPDFException
Throws:
EasyPDFException

AddWatermark

public void AddWatermark(java.lang.String InputFileName,
                         java.lang.String OutputFileName,
                         int EprnWmarkHPosition,
                         int EprnWmarkVPosition,
                         int EprnWmarkZOrder,
                         int EprnWmarkAlignment,
                         double hoffset,
                         double voffset,
                         boolean bfirstpageonly,
                         java.lang.String font,
                         int fontsize,
                         int embeds,
                         int angle,
                         int color,
                         int opacity,
                         boolean boutlineonly,
                         java.lang.String text)
                  throws EasyPDFException
Throws:
EasyPDFException

EasyPDF Java SDK
v5.1

Copyright 2007 BCL Technologies. All rights reserved.