public class ConcatPDF extends Object
java ca.bc.webarts.tools.ConcatPDF destfile file1 file2 [file3 ...]
java ca.bc.webarts.tools.ConcatPDF destfile file1 file2 insertPageNum
java ca.bc.webarts.tools.ConcatPDF destfile directoryName
Modifier and Type | Field and Description |
---|---|
private static String |
eol_ |
private int |
insertPage_
An optional page number at which to insert the the 2nd file into the first.
|
private static String |
usage_
The simple usage help message..
|
Constructor and Description |
---|
ConcatPDF()
A basic empty constructor for ConcatPDF class that does nothing but
instantiate the class.
|
ConcatPDF(String targetPdf,
String pdfDirectory)
A constructor for ConcatPDF class that takes a directory and
concatenates ALL the pdf files into the targetPDF file.
|
ConcatPDF(String targetPdf,
String[] filenames)
A constructor for ConcatPDF class that takes a array of filenames and
concatenates them all into the targetPDF file.
|
ConcatPDF(String targetPdf,
String first,
String second,
int insertIntoPage)
A constructor for ConcatPDF class that does 'insert into' concatenation
(one into the other at the spec'd page) into a NEW PDF file.
|
Modifier and Type | Method and Description |
---|---|
boolean |
concatFiles(String targetPdf,
String[] filenames)
A helper method to do the DEFAULT concating of individual files one
after the other.
|
boolean |
concatFilesFromDirectory(String targetPdf,
String pdfDirectory,
boolean recurse)
A helper method to take a directory name, search it for PDF files and then
concatenate them into the targetPdf.
|
int |
countPdfsInDir(String pdfDirectory)
Counts the PDFs in a given dir.
|
int |
getInsertPage()
Get Method for class field 'insertPage_'.
|
boolean |
insertConcat(String targetPdf,
String firstPDF,
String secondPDF,
int insertPage)
A helper method to concats the 2nd PDF into the 1st at the spec'd page
into the targetPdf.
|
protected boolean |
isThisAPdfFile(File fileToCheck)
Checks if the passef File is a PDF file (ie has a pdf extension).
|
static void |
main(String[] args)
The main program for the ConcatPDF class.
|
static void |
printUsage()
Prints the Class usage to System.out.
|
void |
setInsertPage(int insertPage)
Set Method for class field 'insertPage_'.
|
private int insertPage_
public ConcatPDF()
public ConcatPDF(String targetPdf, String[] filenames)
targetPdf
- The resultant target PDF file after concatenation.filenames
- the pdf files to concat.public ConcatPDF(String targetPdf, String pdfDirectory)
targetPdf
- The resultant target PDF file after concatenation.pdfDirectory
- A directory to search for PDFs.public ConcatPDF(String targetPdf, String first, String second, int insertIntoPage)
targetPdf
- The resultant target PDF file after concatenation.first
- The 1st PDF file for concatenation.second
- The 2nd PDF file for concatenation.insertIntoPage
- the page number to insert the 2nd PDF at..public boolean concatFiles(String targetPdf, String[] filenames)
targetPdf
- The resultant target PDF file after concatenation.filenames
- the pdf files to concat.public void setInsertPage(int insertPage)
insertPage
- is the value to set this class field to.public int getInsertPage()
public static void printUsage()
public boolean concatFilesFromDirectory(String targetPdf, String pdfDirectory, boolean recurse)
targetPdf
- The resultant target PDF file after concatenation.pdfDirectory
- A directory to search for PDFs.recurse
- recurse into the sub-dirs (NOT IMPLEMENTED YET).public boolean insertConcat(String targetPdf, String firstPDF, String secondPDF, int insertPage)
targetPdf
- The resultant target PDF file after concatenation.firstPDF
- The first PDF to concat the second into.secondPDF
- The PDF to insert into the first at the spec'd page.insertPage
- the page to insert the 2nd file at.public int countPdfsInDir(String pdfDirectory)
protected boolean isThisAPdfFile(File fileToCheck)
public static void main(String[] args)
java ca.bc.webarts.tools.ConcatPDF destfile file1 file2 [file3 ...]
java ca.bc.webarts.tools.ConcatPDF destfile file1 file2 insertPageNum
java ca.bc.webarts.tools.ConcatPDF destfile directoryName
args
- The command line argumentsWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses