public class XprHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
FILE_PROTOCOL
URL protocol for local file
|
private static boolean |
imageOnErrorIconMode
Flag indicating to use ICON image loading error mode.
|
private static java.util.logging.Logger |
LOG
Logger.
|
private static java.util.Map<PrintOptions.PageSize,NativeDimension> |
pageSizes
Page size in pixels map.
|
private static java.lang.String |
PDF_MIME
MIME type for PDF files.
|
private static java.lang.String |
PDF_SUFFIX
Standard suffix of PDF file name.
|
private static int |
pdfDPI
Current DPI value for PDF file to render.
|
private static int |
pdfPageHeight
The height in pixels of the generagted PDF file.
|
private static int |
pdfPageWidth
The width in pixels of the generagted PDF file.
|
private static boolean |
simpleUse
Flag indicating we use the class locally via main() method.
|
Constructor and Description |
---|
XprHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
displayOrLogError(java.lang.String msg)
Log the error and display in case of simple usage when no server and clients are running.
|
static void |
displayOrLogError(java.lang.String msg,
boolean showError)
Log the error and optionally display in case of simple usage when no server and clients are
running.
|
static void |
displayOrLogError(java.lang.String msg,
java.lang.Exception excpt)
Log the error and display in case of simple usage when no server and clients are running.
|
static void |
displayOrLogError(java.lang.String msg,
java.lang.Exception excpt,
boolean showError)
Log the error and optionally display in case of simple usage when no server and clients are
running.
|
static double |
getCol2Pix(int dpi,
double cpi)
Conputes the value of column to pixel factor.
|
static java.io.InputStream |
getInputStream(java.lang.String fileName)
Obtains input stream object for given filename depending on run time mode.
|
static int |
getPdfDPI()
Returns the current DPI value for device independent operations.
|
static int |
getPdfPageHeight()
Returns the height the output PDF file expects to have.
|
static int |
getPdfPageWidth()
Returns the with the output PDF file expects to have.
|
static double |
getRow2Pix(int dpi,
double lpi)
Conputes the value of row to pixel factor.
|
static boolean |
isSimpleUseMode()
Returns
TRUE if class was executed in standalone command line mode without
server and client. |
static void |
logInfo(java.lang.String msg)
Log the information message to the stadard error stream.
|
static void |
main(java.lang.String[] args)
The command line entry point.
|
static boolean |
onErrorImageSilentMode()
Returns
TRUE if PDF file should ignore missing image file displaying icon
instead of missing file. |
static void |
printFile(character xprFileName,
character pdfFileName)
Convert the given XPR file to PDF.
|
static void |
printFile(character xprFileName,
java.lang.String pdfFileName)
Convert the given XPR file to PDF.
|
static void |
printFile(java.lang.String xprFileName,
character pdfFileName)
Convert the given XPR file to PDF.
|
static void |
printFile(java.lang.String xprFileName,
java.lang.String pdfFileName)
Convert the given XPR file to PDF.
|
private static void |
printFile(java.lang.String xprFileName,
java.lang.String pdfFileName,
boolean simpleUse)
Convert the given XPR file to PDF.
|
static void |
printPdf(character xprFileName)
Convert the given XPR file to a temporary PDF file with a unique name.
|
static void |
printPdf(java.lang.String xprFileName)
Convert the given XPR file to a temporary PDF file with a unique name.
|
private static final java.lang.String PDF_SUFFIX
private static final java.lang.String PDF_MIME
private static final java.lang.String FILE_PROTOCOL
private static boolean simpleUse
private static boolean imageOnErrorIconMode
private static int pdfPageWidth
private static int pdfPageHeight
private static int pdfDPI
private static java.util.Map<PrintOptions.PageSize,NativeDimension> pageSizes
private static final java.util.logging.Logger LOG
public static void printPdf(character xprFileName)
xprFileName
- The name of the XPR file to process.public static void printPdf(java.lang.String xprFileName)
xprFileName
- The name of the XPR file to process.public static void printFile(character xprFileName, character pdfFileName)
xprFileName
- The name of the XPR file to process.pdfFileName
- The name of the PDF file to create.public static void printFile(java.lang.String xprFileName, character pdfFileName)
xprFileName
- The name of the XPR file to process.pdfFileName
- The name of the PDF file to create.public static void printFile(character xprFileName, java.lang.String pdfFileName)
xprFileName
- The name of the XPR file to process.pdfFileName
- The name of the PDF file to create.public static void printFile(java.lang.String xprFileName, java.lang.String pdfFileName)
xprFileName
- The name of the XPR file to process.pdfFileName
- The name of the PDF file to create.public static double getRow2Pix(int dpi, double lpi)
dpi
- The device dependent DPI.lpi
- The lines per inch value.public static double getCol2Pix(int dpi, double cpi)
dpi
- The device dependent DPI.cpi
- The columns per inch value.public static boolean isSimpleUseMode()
TRUE
if class was executed in standalone command line mode without
server and client.public static boolean onErrorImageSilentMode()
TRUE
if PDF file should ignore missing image file displaying icon
instead of missing file.public static int getPdfPageWidth()
public static int getPdfPageHeight()
public static int getPdfDPI()
public static java.io.InputStream getInputStream(java.lang.String fileName)
fileName
- The name of the file to open.NULL
in case of failure.private static void printFile(java.lang.String xprFileName, java.lang.String pdfFileName, boolean simpleUse)
xprFileName
- The name of the XPR file to process.pdfFileName
- The name of the PDF file to create.simpleUse
- The flag indicating simple call via main without client/server running.public static void displayOrLogError(java.lang.String msg)
msg
- The message to log or display.public static void displayOrLogError(java.lang.String msg, boolean showError)
msg
- The message to log or display.showError
- When TRUE
display error message, FALSE
- only logging.public static void displayOrLogError(java.lang.String msg, java.lang.Exception excpt)
msg
- The message to log or display.excpt
- Optional exception to get issue details.public static void displayOrLogError(java.lang.String msg, java.lang.Exception excpt, boolean showError)
msg
- The message to log or display.excpt
- Optional exception to get issue details.showError
- When TRUE
display error message, FALSE
- only logging.public static void logInfo(java.lang.String msg)
msg
- The message to log.public static void main(java.lang.String[] args)
args
- The array of command-line parameters.