public class CropPDF extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
acroCmd_
The path/command to run the acroreader.
|
private static float |
bottomCropBorder_
The bottom Cropped amount in inches.
|
static String |
DEFAULT_INPUT_FILENAME
Default input filename.
|
private static boolean |
doTheScale_
Flags if the cropped page will also be scalled to max fit on the
new output page.
|
private static float |
evenBottomCropBorder_
EVEN Page bottom Cropped amount in inches.
|
private static float |
evenLeftCropBorder_
EVEN Page left Cropped amount in inches.
|
private static boolean |
evenOddPageCrops_
flags if there are different crop borders for the even pages as opposed to
the even pages.
|
private static float |
evenRightCropBorder_
EVEN Page right Cropped amount in inches.
|
private static float |
evenTopCropBorder_
EVEN Page top Cropped amount in inches.
|
private static String |
inFileName_
The input filename that will be cropped and saved in output filename.
|
private static boolean |
launchAcroread_
Flags the auto execution of acro reader after the cropping.
|
private static boolean |
launchGui_
Flags whether the gui launches on startup.
|
private static float |
leftCropBorder_
The left Cropped amount in inches.
|
private static String |
outFileName_
The output filename string.
|
private static Rectangle |
outputPageSize_
The size of the resultant page.
|
private static float |
rightCropBorder_
The right Cropped amount in inches.
|
private static double |
rotation_
An angle in Radians to rotate the page after it has been cropped.
|
private static float |
scale_
A scaling ratio to enlarge the newly cropped page
if scaling is enabled.
|
private static float |
topCropBorder_
The top Cropped amount in inches.
|
private static String |
usage_
The usage string.
|
Constructor and Description |
---|
CropPDF()
Default Constructor assumes default values for EVERYTHING.
|
CropPDF(float left,
float right,
float top,
float bottom)
Constructor that takes the edge crop sizes in inches.
|
CropPDF(float evenleft,
float evenright,
float eventop,
float evenbottom,
float left,
float right,
float top,
float bottom)
Constructor that takes the edge crop sizes in inches for even pages and odd pages
|
CropPDF(float evenleft,
float evenright,
float eventop,
float evenbottom,
float left,
float right,
float top,
float bottom,
String fName)
Constructor that takes the edge crop sizes in inches for even pages and odd pages
|
CropPDF(float left,
float right,
float top,
float bottom,
String fName)
Constructor that takes the edge crop sizes in inches.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doCrop()
Executes the cropping/resizing as specified by the class parms.
|
boolean |
doCrop(boolean doingEvenOddCrops)
Executes the cropping/resizing as specified by the class parms.
|
float |
getBottomCropBorder()
Getter.
|
boolean |
getDoTheScale()
Getter.
|
float |
getEvenBottomCropBorder()
Getter.
|
float |
getEvenLeftCropBorder()
Getter.
|
float |
getEvenRightCropBorder()
Getter.
|
float |
getEvenTopCropBorder()
Getter.
|
String |
getInFileName()
Getter.
|
float |
getLeftCropBorder()
Getter.
|
String |
getOutFileName()
Getter.
|
float |
getRightCropBorder()
Getter.
|
float |
getTopCropBorder()
Getter.
|
static void |
main(String[] args)
The main program for the CropPDF class
|
private boolean |
parseCmdlineParms(String[] args)
Parses the input commandline parameters and assigns the various class
variables.
|
static Document |
parsePDFFile(String inFileName)
Executes the reading of a PDF file into a Document Object.
|
void |
setBottomCropBorder(float bottomCropBorder)
Setter.
|
void |
setDoTheScale(boolean doTheScale)
Setter.
|
void |
setEvenBottomCropBorder(float evenBottomCropBorder)
Setter.
|
void |
setEvenLeftCropBorder(float evenLeftCropBorder)
Setter.
|
void |
setEvenRightCropBorder(float evenRightCropBorder)
Setter.
|
void |
setEvenTopCropBorder(float evenTopCropBorder)
Setter.
|
void |
setInFileName(String inFileName)
Setter for input filename.
|
void |
setLeftCropBorder(float leftCropBorder)
Setter.
|
void |
setOutFileName()
Setter.
|
void |
setOutFileName(String outFileName)
Setter.
|
void |
setRightCropBorder(float rightCropBorder)
Setter.
|
void |
setTopCropBorder(float topCropBorder)
Setter.
|
public static final String DEFAULT_INPUT_FILENAME
private static String inFileName_
private static String outFileName_
private static float leftCropBorder_
private static float rightCropBorder_
private static float topCropBorder_
private static float bottomCropBorder_
private static float evenLeftCropBorder_
private static float evenRightCropBorder_
private static float evenTopCropBorder_
private static float evenBottomCropBorder_
private static double rotation_
private static Rectangle outputPageSize_
private static float scale_
private static boolean evenOddPageCrops_
private static boolean launchAcroread_
private static boolean launchGui_
private static boolean doTheScale_
public CropPDF()
public CropPDF(float left, float right, float top, float bottom)
public CropPDF(float left, float right, float top, float bottom, String fName)
public CropPDF(float evenleft, float evenright, float eventop, float evenbottom, float left, float right, float top, float bottom)
public static void main(String[] args)
args
- The command line argumentsprivate boolean parseCmdlineParms(String[] args)
public static Document parsePDFFile(String inFileName)
public boolean doCrop()
public boolean doCrop(boolean doingEvenOddCrops)
public void setLeftCropBorder(float leftCropBorder)
public float getLeftCropBorder()
public void setEvenLeftCropBorder(float evenLeftCropBorder)
public float getEvenLeftCropBorder()
public void setRightCropBorder(float rightCropBorder)
public float getRightCropBorder()
public void setEvenRightCropBorder(float evenRightCropBorder)
public float getEvenRightCropBorder()
public void setTopCropBorder(float topCropBorder)
public float getTopCropBorder()
public void setEvenTopCropBorder(float evenTopCropBorder)
public float getEvenTopCropBorder()
public void setBottomCropBorder(float bottomCropBorder)
public float getBottomCropBorder()
public void setEvenBottomCropBorder(float evenBottomCropBorder)
public float getEvenBottomCropBorder()
public void setDoTheScale(boolean doTheScale)
public boolean getDoTheScale()
public void setInFileName(String inFileName)
public String getInFileName()
public void setOutFileName()
public void setOutFileName(String outFileName)
public String getOutFileName()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses