I have a COTG document where users can add additional pages and draw on them. Created a script to add the additional pages. Which it does complete with overlaying the correct image on top. But it also adds an additional copy of the page without the image. Does the same with every additional page
not seeing where it’s coming from. Here is the script
var numPage2 = record.tables.detailPage1.length;
var printSections = merge.template.contexts.Print.sections;
if( numPage2 > 1) //there is always a first page
{
for( var i = 1; i < numPage2; i++)
{
var image = record.tables.detailPage1[i].fields["image_annotation1-note-data"];
var clone = printSections["Page2"].clone();
var clone.name = "Page2-"+i;
clone.html("<br><br>" + image) //image holds annotation
clone.enabled = true;
printSections["Page2"].addAfter(clone);
}
}
If you remove the cloning script, does the section display 1 or 2 pages? If it displays 2, each clone will do so as well.
If that’s not the issue, then try commenting out the clone.html("<br><br>" + image) statement in your script: it might trigger an overflow, which would account for the second page on each clone.
If I comment out the clone.html line I get two copies of the page with the first page image and not the third page. Also noticed on the original one the second and third pages have red dotted lines at the bottom
Looks like it’s how I’m adding the image on to subsequent pages