you should maintain a flag on page level
bool isFirstPagePrinted = false;
when first time event called...
if(!isFirstPagePrinted)
(
yPosition = 590;
topMargin = 590;
isFirstPagePrinted = true;
}
else
{
yPosition = 100;
topMargin = 100;
}
Hope this approch will be helpful
you can reset
isFirstPagePrinted = false;
on click of your "print" button
Happy coding! :)