Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Reader/Acrobat: print to network printer not setup on client??

Avatar

Level 4
This is maybe more an Acrobat/Reader question than Adobe Designer.



Is there anyone that knows a clever solution to print silently to a network printer, that is not setup on the client that prints the form?



The Scenario:

User fills out a form and prints on his/her default printer. I need to print one of the pages on a printer in another department (always this printer - is accessible in the network). Is this posible directly from the client, or do I need Adobe Forms?



I use JetForm Central server today from JetForm Filler. I know that JetForm Central will come as an Adobe Product in time, but some time will pass im sure!

/Thomas G

Jyske Bank - Denmark
10 Replies

Avatar

Former Community Member
Don't hold your breath ... "JetForm Filler" is a defunct product. Version 5 was the final one of the "Filler" product line. Starting with version 6 Adobe began using their "Reader" as the "filler" product. Adobe still supports the "JetForm Central" product (renamed as Adobe Output Server and Adobe Output Designer) but updates are few and far between (I just got 5.6 after several years at 5.5).

Avatar

Former Community Member
You are correct this more of a client question. You could create a custom print button that printed to both the default an a separate printer as two separate actions when executed as a menu item if you used a Folder Level JS. Look at the "printerNames" and "PrintParams Object".



~T

Avatar

Level 4
I have looked at the printerNames and PrintParams Object. As I see it you cannot print agains a printerconnection not known on the client.<br /><br />Lets say i wanna print on the default printer AND on the printer \\da1234\P1799<br />where \\<servername>\<printer><br /><br />If anyone know a way to do this please, give more info!<br /><br />/Thomas G <br />Jyske Bank - Denmark

Avatar

Former Community Member
Thomas,



I have a way of doing this but there are several conditions:



1. a trusted function and batch file needs to be installed on the local pc

2. a popup dialog box will display each time you print



If those two items are ok, I can send you a solution.



John

Avatar

Level 4
Hi John



The forms requreing this function is only used internal, so we can place trustedscript, and allready use trusted script to get loginname and other tasks.



The popup you are mentioning, is that the javascript warning? - could be acceptable - and think I can work-around it.



I would like to hear more about your solution :)

TG@Jyskebank.dk



/Thomas G

Jyske Bank - Denmark

Avatar

Former Community Member
Hi Thomas,



I am sending my code below. This solution did not meet our business requirements because of the high volume of printing. I am currently working on a second solution which, if it works, will not prompt the user (2 times) when ever they print. When I get this working, I will post it here.



Anyhow, here are the trusted functions:

As you know, place this into the C:\Program Files\Adobe\Acrobat 7.0\Reader\Javascripts folder.



changePrinter.js:



mySwitchPrinter = app.trustPropagatorFunction(function(doc,printerName) {

app.beginPriv();

app.launchURL("file:///C:\\CEIS\\ChangePrinter.bat?p1=" + printerName, true);

app.endPriv();

});



switchPrinterFunction=app.trustedFunction(function(doc,printerName) {

app.beginPriv();

mySwitchPrinter(doc,printerName);

app.endPriv();

});



Then, the ChangePrinter.bat file looks like:



@ECHO OFF

if "%1"=="" goto usage

RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n %1

goto end



:usage

echo Usage: ChangePrinter [name]

:end

@ECHO ON

pause



I think that is everything that I did. It has been a while since I put this together.

Avatar

Level 4
Thanks John



I will look into it!



You mention that you have high volume print - what product do you use for this? and is it done on livecycle platform and are your formsin pdf? As I see it, this will require a serverproduct as FormsServer or LiveCycle Print or...?



/Thomas

Avatar

Former Community Member
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);

}

}

}

Avatar

Level 4
Very clever :)



I might be able to use this solution for duplex print.. if I can convice our print people to setup extra queue and they will except the solution.



We have decided to start with a solution based on reader extention server and forms filled in reader. No Forms or other server products to start with. I do think that Adobe Forms will come into the picture later on.. we will see.



Thanks a lot for your input - hope to share solutions and ideas with you later on

/Thomas

Avatar

Former Community Member
one more additional note:



the above code does change readers default printer for the current session. So if you want to print another pdf, it will print to the printer selected in the above function.



To have reader automatically revert back to the system default, print to a null printer, that is, add the following code:



objPrintParams.printerName = null;

event.target.print(objPrintParams);