|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.tools.LPR
public class LPR
Modified!
This class provides methods for the Line Printer Daemon Protocol
more info about LPD/LPR
Nested Class Summary | |
---|---|
private class |
LPR.PrintJob
Job ************************ |
Field Summary | |
---|---|
private java.lang.String |
cfA
|
private boolean |
cfA_banner
|
private boolean |
cfA_formatted
|
private boolean |
cfA_postscript
|
private boolean |
cfA_pr
|
private java.lang.String |
cfAlen
|
private int |
copies
|
private java.lang.String |
host
|
private java.lang.String |
hostname
|
private java.lang.String |
jobname
|
private java.util.Vector |
jobs
|
private int |
port
|
private int |
timeout
|
static int |
UNKNOWN
|
private java.lang.String |
user
|
Constructor Summary | |
---|---|
LPR()
default constructor without parameters, standard port is 515 |
|
LPR(java.lang.String host,
int port,
java.lang.String user)
constuctor with host, port and username |
|
LPR(java.lang.String host,
java.lang.String user)
constuctor with host and username standard port is 515 |
Method Summary | |
---|---|
private void |
close(java.net.Socket socket,
java.io.BufferedReader in,
java.io.DataOutputStream out)
closed connection to the LPD |
private java.net.Socket |
connect()
connect to the LPD Server |
private java.lang.String |
fillLeft(java.lang.String data,
int size,
java.lang.String filler)
|
boolean |
getCfA_banner()
get if job printed with banner page |
java.lang.String |
getCfA_jobname()
get the job name |
boolean |
getCfA_postscript()
get if file printed as postscript file |
boolean |
getCfA_pr()
get if print file with 'pr' format |
int |
getCopies()
get Copies |
java.lang.String |
getHost()
get LPD host |
java.lang.String |
getHostname()
get the host name for this computer |
private java.lang.String |
getNewJobId()
|
int |
getPort()
get LPD port |
java.lang.String |
getQueueState(java.lang.String queue,
boolean shortstate)
gets the state and description of the printer queue in short or long format |
int |
getTimeout()
get the timeout for any commands |
java.lang.String |
getUser()
get username |
private void |
makecfA(java.lang.String document,
java.lang.String jobid)
internal methode to create the control file |
java.lang.String |
print(java.lang.String queue,
byte[] dfA,
java.lang.String document)
print a byte array with the document name as parameter |
java.lang.String |
print(java.lang.String queue,
char[] dfA,
java.lang.String document)
print a char array with the document name as parameter |
java.lang.String |
print(java.lang.String queue,
java.io.File file,
java.lang.String document)
print a file with the document name as parameter |
private boolean |
print(java.lang.String queue,
java.lang.String document,
byte[] dfA1,
char[] dfA2,
int mode,
java.lang.String jobid)
internal funktion for printing |
java.lang.String |
print(java.lang.String queue,
java.lang.String dfA,
java.lang.String document)
print a String with the document name as parameter |
boolean |
printWaitingJobs(java.lang.String queue)
Print any waiting jobs |
boolean |
removeJob(java.lang.String queue,
java.lang.String user,
java.lang.String jobid)
Remove job |
void |
setCfA_banner(boolean value)
set if job printed with banner page |
void |
setCfA_jobname(java.lang.String value)
set the job name |
void |
setCfA_postscript(boolean value)
set if file printed as postscript file |
void |
setCfA_pr(boolean value)
p - Print file with 'pr' format |
void |
setCopies(int value)
set Copies |
void |
setHost(java.lang.String value)
set LPD host |
void |
setHostname(java.lang.String value)
set the host name for this computer |
void |
setPort(int value)
set LPD port |
void |
setTimeout(int timeout)
set the timeout for any commands |
void |
setUser(java.lang.String value)
set username |
void |
waitFor(java.lang.String jobid)
wait until job is printed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNKNOWN
private java.lang.String host
private int port
private java.lang.String user
private java.util.Vector jobs
private java.lang.String hostname
private java.lang.String jobname
private java.lang.String cfAlen
private java.lang.String cfA
private int copies
private int timeout
private boolean cfA_formatted
private boolean cfA_postscript
private boolean cfA_banner
private boolean cfA_pr
Constructor Detail |
---|
public LPR()
public LPR(java.lang.String host, java.lang.String user)
public LPR(java.lang.String host, int port, java.lang.String user)
Method Detail |
---|
public void setHost(java.lang.String value)
public java.lang.String getHost()
public void setPort(int value)
public int getPort()
public void setUser(java.lang.String value)
public java.lang.String getUser()
public void setTimeout(int timeout)
public int getTimeout()
public boolean getCfA_postscript()
public void setCfA_postscript(boolean value)
o option in control file
This command prints the data file to be printed, treating the data as standard Postscript input.
public java.lang.String getCfA_jobname()
public void setCfA_jobname(java.lang.String value)
J option in control file
This command sets the job name to be printed on the banner page. The name of the job must be 99 or fewer octets. It can be omitted. The job name is conventionally used to display the name of the file or files which were "printed". It will be ignored unless the print banner command ('L') is also used.
public boolean getCfA_pr()
public void setCfA_pr(boolean value)
p - Print file with 'pr' format
This command causes the data file to be printed with a heading, page numbers, and pagination. The heading should include the date and time that printing was started, the title, and a page number identifier followed by the page number. The title is the name of file as specified by the 'N' command, unless the 'T' command (title) has been given. After a page of text has been printed, a new page is started with a new page number. (There is no way to specify the length of the page.)
public boolean getCfA_banner()
public void setCfA_banner(boolean value)
L option in control file
This command causes the banner page to be printed. The user name can be omitted. The class name for banner page and job name for banner page commands must precede this command in the control file to be effective.
public java.lang.String getHostname()
public void setHostname(java.lang.String value)
public void setCopies(int value)
public int getCopies()
public boolean printWaitingJobs(java.lang.String queue)
This command starts the printing process if it not already running.
public boolean removeJob(java.lang.String queue, java.lang.String user, java.lang.String jobid)
This command deletes the print jobs from the specified queue which are listed as the other operands. If only the agent is given, the command is to delete the currently active job. Unless the agent is "root", it is not possible to delete a job which is not owned by the user. This is also the case for specifying user names instead of numbers. That is, agent "root" can delete jobs by user name but no other agents can.
public java.lang.String getQueueState(java.lang.String queue, boolean shortstate)
public java.lang.String print(java.lang.String queue, byte[] dfA, java.lang.String document)
{
public java.lang.String print(java.lang.String queue, java.lang.String dfA, java.lang.String document)
{
public java.lang.String print(java.lang.String queue, char[] dfA, java.lang.String document)
{
public java.lang.String print(java.lang.String queue, java.io.File file, java.lang.String document)
{
public void waitFor(java.lang.String jobid)
private boolean print(java.lang.String queue, java.lang.String document, byte[] dfA1, char[] dfA2, int mode, java.lang.String jobid)
private java.net.Socket connect()
private void close(java.net.Socket socket, java.io.BufferedReader in, java.io.DataOutputStream out)
private void makecfA(java.lang.String document, java.lang.String jobid)
private java.lang.String getNewJobId()
private java.lang.String fillLeft(java.lang.String data, int size, java.lang.String filler)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |