Expand my Community achievements bar.

SOLVED

Master page was printed

Avatar

Former Community Member

Hi everybody,
I have a javascript to control a page named "Blank" to display in my form .The "Blank" page is not included in page Numbering. Here is the java code:

var myCount = xfa.layout.pageCount();
if(myCount%4 > 0){
this._Blank.setInstances(4-(myCount%4));
var myPages = this.resolveNodes("Blank[*]");
for(var q=0; q<myPages.length; q++){
  myPages.item(q).presence = "visible";
}
}else{
this._Blank.setInstances(0);
}

When I open the pdf , the page number is 17,so the Blank page needs to dispay (3 pages). It works functionally.
When I print the pdf , there are some hidden pages need to display(3 pages). So the Blank page do not needs to display. But now the pdf adds a extra blank page in my form . I test it is the Blank's Master Page .

Can someone help me?

Thanks a lot .
Jing

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi,

I think I fixed the issue…

I add 3 Blank pages in my form instead of using a repeat Blank page.

Here is the first Blank page's  calculate event javascript :

var myCount = xfa.layout.pageCount();
var blankNumber = 4-(myCount%4);

xfa.layout.relayout();

if(blankNumber >0 && blankNumber<4)
{
this.presence = "visible";
}else{
this.presence = "hidden";
}

The  second Blank page's code should only change the "if(blankNumber >0 && blankNumber<4)" to "if(blankNumber >1 && blankNumber<4)",

The third Blank page's code should only change the "if(blankNumber >0 && blankNumber<4)" to "if(blankNumber >2 && blankNumber<4)",

Thanks,

Jing

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

Hi,

I think I fixed the issue…

I add 3 Blank pages in my form instead of using a repeat Blank page.

Here is the first Blank page's  calculate event javascript :

var myCount = xfa.layout.pageCount();
var blankNumber = 4-(myCount%4);

xfa.layout.relayout();

if(blankNumber >0 && blankNumber<4)
{
this.presence = "visible";
}else{
this.presence = "hidden";
}

The  second Blank page's code should only change the "if(blankNumber >0 && blankNumber<4)" to "if(blankNumber >1 && blankNumber<4)",

The third Blank page's code should only change the "if(blankNumber >0 && blankNumber<4)" to "if(blankNumber >2 && blankNumber<4)",

Thanks,

Jing

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