We are using the LiveCycle Forms product. XML data is exported from an Oracle application, merged with an xdp form template and rendered to the client as a pdf. We wrote a custom servlet that does all of this processing. I am currently working on some code that will communicate with our reader extensions server and automatically enable rights in the pdf.
We have approximately 500 users who print/produce 20,000 - 25,000 forms a month.
It works great.
In regards to printing, we also have network printers. The problem we have is 2/3 of our forms have a legal requirement to be duplex printed, but the network printers are setup to single print. So, we have added a second print queue on each printer/workstation. This new print queue has the duplex print option enabled and I have some code that automatically prints to this new queue. Our previous solution did the printer switch while in the Oracle application through plsql. This is not ideal because it actually changed the users default printer. Recently, I found some javascript code on this forum that allows the pdf to print to a different printer. I have customized this code and built the following function (this is called from a custom print button on the pdf):
function duplexPrint(xfa, nFromPage, nToPage) {
// relies on a naming structure such that the duplex printer
// name is the same as the default printer name with the
// addition of 'Dup'
try {
var defaultPrinter = xfa.record.capture_data.default_printer.value;
var duplexPrinter = defaultPrinter + "Dup";
} catch(e) {
var defaultPrinter = "";
var duplexPrinter = "";
}
// search through the list of printers on the users workstation.
// look for the duplex printer name.
var nCount = app.printerNames.length;
var pIndex = 0;
var bFound = false;
while (pIndex < nCount && !bFound) {
if (app.printerNames[pIndex] == defaultPrinter+"Dup" || app.printerNames[pIndex] == defaultPrinter+"DUP" ||app.printerNames[pIndex] == defaultPrinter+"dup") {
bFound = true;
} else {
pIndex++;
}
}
var objPrintParams = event.target.getPrintParams();
// Set so no dialog box is displayed at all to the user during printing
objPrintParams.interactive = objPrintParams.constants.interactionLevel.silent;
objPrintParams.firstPage = nFromPage;
objPrintParams.lastPage = nToPage;
// Select which printer to print to
if (bFound) {
objPrintParams.printerName = duplexPrinter;
} else {
objPrintParams.printerName = defaultPrinter;
}
// send to printer, if no printer then use the default.
if (defaultPrinter == "") {
xfa.host.print(0, nFromPage.toString(), nToPage.toString(), 0, 0, 0, 0, 0);
} else {
// Print the PDF using properties just set with printParams object
try {
event.target.print(objPrintParams);
} catch(e) {
app.alert("Printing error: " + e);
}
}
}