Expand my Community achievements bar.

SOLVED

Print button that prints particular pages of form

Avatar

Level 2

Hi, I'm not familiar with scripting, but I'm thinking a script might be necessary for what I want to do.  I have a form that is 4 pages long.  The first two pages are instructions, the last two are the actual form.  Can I add a print button to the document that will print the last two pages rather than the entire document?  And would the button need to be on the 3rd page (top of the actual form) or the 4th page (end of form)? Thanks!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Can I add a print button to the document that will print the last two pages rather than the entire document? 

Yes.

// form1.page1.printBtn::click - (JavaScript, client)

xfa.host.print(1, "2", "3", 0, 0, 0, 0, 0);

And would the button need to be on the 3rd page (top of the actual form) or the 4th page (end of form)?

The print button can go anywhere.

Steve

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Can I add a print button to the document that will print the last two pages rather than the entire document? 

Yes.

// form1.page1.printBtn::click - (JavaScript, client)

xfa.host.print(1, "2", "3", 0, 0, 0, 0, 0);

And would the button need to be on the 3rd page (top of the actual form) or the 4th page (end of form)?

The print button can go anywhere.

Steve

Avatar

Level 2

Steve, thank you so much!  It worked perfectly!

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