[ 1684853 ] Add Print Preview button
This commit is contained in:
parent
0dc865317d
commit
4a5b39811f
|
@ -799,10 +799,10 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write PostScript to writer
|
* Write PostScript to writer
|
||||||
* @param fos file output stream
|
* @param os output stream
|
||||||
* @return true if success
|
* @return true if success
|
||||||
*/
|
*/
|
||||||
public boolean createPS (FileOutputStream fos)
|
public boolean createPS (OutputStream os)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -817,7 +817,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
||||||
}
|
}
|
||||||
// just use first one - sun.print.PSStreamPrinterFactory
|
// just use first one - sun.print.PSStreamPrinterFactory
|
||||||
// System.out.println("- " + spsfactories[0]);
|
// System.out.println("- " + spsfactories[0]);
|
||||||
StreamPrintService sps = spsfactories[0].getPrintService(fos);
|
StreamPrintService sps = spsfactories[0].getPrintService(os);
|
||||||
// get format
|
// get format
|
||||||
if (m_layout == null)
|
if (m_layout == null)
|
||||||
layout();
|
layout();
|
||||||
|
@ -825,8 +825,10 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
|
||||||
sps.createPrintJob().print(m_layout.getPageable(false),
|
sps.createPrintJob().print(m_layout.getPageable(false),
|
||||||
new HashPrintRequestAttributeSet());
|
new HashPrintRequestAttributeSet());
|
||||||
//
|
//
|
||||||
fos.flush();
|
os.flush();
|
||||||
fos.close();
|
//following 2 line for backward compatibility
|
||||||
|
if (os instanceof FileOutputStream)
|
||||||
|
((FileOutputStream)os).close();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,10 @@ public class ProcessInfo implements Serializable
|
||||||
setAD_Process_ID(AD_Process_ID);
|
setAD_Process_ID(AD_Process_ID);
|
||||||
setTable_ID (Table_ID);
|
setTable_ID (Table_ID);
|
||||||
setRecord_ID (Record_ID);
|
setRecord_ID (Record_ID);
|
||||||
|
if (Ini.isPropertyBool(Ini.P_PRINTPREVIEW))
|
||||||
|
m_printPreview = true;
|
||||||
|
else
|
||||||
|
m_printPreview = false;
|
||||||
} // ProcessInfo
|
} // ProcessInfo
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,6 +109,8 @@ public class ProcessInfo implements Serializable
|
||||||
|
|
||||||
/** Transaction Name */
|
/** Transaction Name */
|
||||||
private String m_transactionName = null;
|
private String m_transactionName = null;
|
||||||
|
|
||||||
|
private boolean m_printPreview = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -602,4 +608,14 @@ public class ProcessInfo implements Serializable
|
||||||
{
|
{
|
||||||
m_transactionName = trxName;
|
m_transactionName = trxName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPrintPreview(boolean b)
|
||||||
|
{
|
||||||
|
m_printPreview = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPrintPreview()
|
||||||
|
{
|
||||||
|
return m_printPreview;
|
||||||
|
}
|
||||||
} // ProcessInfo
|
} // ProcessInfo
|
||||||
|
|
Loading…
Reference in New Issue