Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
SOLVED

Defualt printer name as Adobe PDF

Avatar

Level 3

Hi,

Need help in printing the Adobe LiveCycle PDF in Adobe PDF defualt.

We have requrement, when user clicks on print buttonm by default printer name should be as Adobe PDF and when user clicks on Ok it should print in PDF istead of hard copy.

Is is possible ?

Thank you,

Jay

1 Accepted Solution

Avatar

Correct answer by
Level 10

Ohh yes, I forgot to correct the script,

Replace "this" with "event.target".

var pp = event.target.getPrintParams();

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

pp.printerName = "Adobe PDF";

event.target.print(pp);

View solution in original post

0 Replies

Avatar

Level 10

Hi,

you can do this with a custom print button in your form and a bit of JavaScript:

var pp = this.getPrintParams();

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

pp.printerName = "Adobe PDF";

this.print(pp);

Note: This script has no effect on the applications print button or the print command ctrl + p.

Avatar

Level 3

Hi Thanks a lot for providing script.

I tried same script on the form and when i click on Custom button, in debugger message is showing as "this.getPrintParams is not a function"

Thank you for your support and help.

Regards,

Jay

Avatar

Correct answer by
Level 10

Ohh yes, I forgot to correct the script,

Replace "this" with "event.target".

var pp = event.target.getPrintParams();

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

pp.printerName = "Adobe PDF";

event.target.print(pp);

Avatar

Level 3

Excellent!!! working as per requirement.

Thanks a lot for the help.

Regards,

Jay

Avatar

Level 3

Hi,

Is there any option or script to change the default PDF file name after generating PDF.

Thank you,

Jay

Avatar

Level 2

Hi Jay,

Did you end up finding a way to dynamically change the PDF file name?  I can change the .ps file name using:

pp.fileName = "/u/forms/purchase order/" + docName + ".ps";

However I get an error when I use:

pp.fileName = "/u/forms/purchase order/" + docName + ".pdf";

Thanks

Stefan