Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Print to Windows Network Shared Printer problem.

Avatar

Level 1

Hello everyone,

I apologies if anyone has read this under the Acrobat Pro forum but I was told I may get some help on this forum. I  have a problem that I am beating my head up against. In my company we  have some pdf documents that have been created using LiveCycle for our  "go green paperless movement" but we have hit a snag. We have some  "virtual printers" in use with our document management software that  work just as normal networked printers but instead capture an image of  the document being printed and run OCR on our documents for record  keeping. Each pdf document has its own virtual printer to recognize  appropriate OCR templates to use. Therefor we have many virutal pritners  for our many documents. We love our LiveCycle documents but, when  attempting to use javascript to print to a particular network printer we  have found our complication. We do not want to map the printers using  windows or train our employees on adding network printers to their  profile as there are so many and each document is assigned to a virtual  OCR printer, we want the document to have an embedded button that  automatically prints to it's assigned virtual printer.

If I open a document and edit it with Acrobat 9 Pro, I can simply place a button field and add this java code:

var  pp=this.getPrintParams();

pp.interactive=pp.constants.interactionLevel.automatic;

pp.printerName="\\\\TOSHIBABILLING2\\pcl6";

this.print(pp);

and  the system prints to the network printer perfectly. Yet if I use that  same javascript in LiveCycle we get nothing. Further reading I found  some details specifying that I cannot use this same scripting to print  to the network printer using LiveCycle and such am at a loss.

I  have tried open the form in Acrobat 9 Pro to edit it and just add the  button using Acrobat Pro, but each time I edit the document it opens  LiveCycle as the designer.

I  was not sure which forum to use as this problem has been found between  working with both programs. Can someone help me to either modify the  code for LiveCycle, or to at least find a way to open the document in  Acrobat 9 Pro to just add the print button to the LiveCycle form. Any  and all assistance would be greatly appreciated.

~ Max

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Soif we simply translated your script that uses the Acroform model to use the xfa model it shoudl work ...right?

Your code in an xfa form woudl look like this:

var oDoc = event.target;

var  pp=oDoc.getPrintParams();

pp.interactive=pp.constants.interactionLevel.automatic;

pp.printerName="\\\\TOSHIBABILLING2\\pcl6";

oDoc.print(pp);

Try that and let us know if it worked.

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Soif we simply translated your script that uses the Acroform model to use the xfa model it shoudl work ...right?

Your code in an xfa form woudl look like this:

var oDoc = event.target;

var  pp=oDoc.getPrintParams();

pp.interactive=pp.constants.interactionLevel.automatic;

pp.printerName="\\\\TOSHIBABILLING2\\pcl6";

oDoc.print(pp);

Try that and let us know if it worked.

Paul

Avatar

Level 1

It worked like a charm. Thank you so much pguerett. I really appreciate it. My headache just went away.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----