Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to add 'warning message' when someone use print option in pdf using LC Designer

Avatar

Level 2

I am using LC Designer and trying to edit in pdf form to add warning message while someone use print option

And I can-not figure out how to add description when someone does that.

is it something related to 'xfa.host.messageBox("Blah Blah")'

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

All you have done is rearrange the statements in the Click event of the button .....I am referring to an event called prePrint. This event is called before the print is done ...this is where your message shoudl go. Then on the click event you can have your normal print command. Here is a sample

paul

View solution in original post

5 Replies

Avatar

Former Community Member

Yes that is the format of a message box to the user ...what event are you placing this warning on?

Paul

Avatar

Level 2

I am just placing warning when someone tries to print to remind them they have to do something.

So for print button the command line goes something like this

form1.#subform[0].PrintButton1::click - (JavaScript, client)

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

xfa.host.messageBox("This is my message!")

----------------------------

And that only works for 'print button' of LC Designer and not of ctrl+p or file/print

Avatar

Former Community Member

You will need to put the message on the prePrint event not on the click event......that is why it is only firing when the click the Print button.

Paul

Avatar

Level 2

hmm.................I even tried doing that way

form1.#subform[0].PrintButton1::click - (JavaScript, client)

xfa.host.messageBox("This is my message!")

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

I assume that is what you mean but it still does not work for all print options

Let me know if you meant something different


Thanks

Avatar

Correct answer by
Former Community Member

All you have done is rearrange the statements in the Click event of the button .....I am referring to an event called prePrint. This event is called before the print is done ...this is where your message shoudl go. Then on the click event you can have your normal print command. Here is a sample

paul

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] ----