Expand my Community achievements bar.

Email & Print to Virtual Printer

Avatar

Level 3

Hi everyone,

I have a button, under this button I perform validations, I check if certain fields are completed before I can allow the user to email the form.

That works perfectly..

The else part is the problem, if the fields are completed I want to email the form, but I want to attach to the email the form that I print to the virtual printer,

so on the else I have this code:

else{

          event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody,cSubmitAs:"PDF",cCharset:"utf-8"}); 

          var oDoc = event.target;

          var  printparam=oDoc.getPrintParams();

          printparam.interactive=printparam.constants.interactionLevel.automatic;

          printparam.printerName="cutePDF Writer";

          oDoc.print(printparam);

      }

How can I achieve what I want...Will appreciate your assistance.

Regards,

Ace

3 Replies

Avatar

Level 10

Hi Ace,

There is an example of printParams() here: https://acrobat.com/#d=Kuivy1SdOSbQnRs3kyeVDQ.

While you can use this method generally, I am fairly sure that you can not set it up to print silently, as this I suspect is a security risk. Eg document printing to a remote printer that the user knows nothing about.

Niall

Avatar

Level 3

Hi Niall,

Thanks.

After testring what I wanted to achieve, I realized that printing to a virtual printer I only get the image of the form.

When I extract the xml from the pdf, the data that was captured is not part of the xml.

My aim for printing to a virtual printer was to dynamically convert the dynamic pdf to static pdf because our records management system cant retrieve data from a dynamic form.

Do you you perhaps know how I can achieve this?

Ace

Avatar

Level 10

Hi Ace,

No, I don't think that you will be able to convert a Dynamic XML Form to a Static PDF Form at runtime. The best you can achieve is print to PDF, but this will only give a "print off" of the form without any embedded data.

Niall