Skip to main content
Participating Frequently
January 24, 2020
Answered

Acrobat Form Print original and copy on button

  • January 24, 2020
  • 1 reply
  • 652 views

Hi, 

I have been struggeling with a way to get a form button to create two printouts. One as the form looks orginally and one with a COPY stamp/watermark on it. I have not gotten any script to work. 

 

Is this possible and if it is how do i do it?

 

Hope you guys can point me in the right direction

This topic has been closed for replies.
Correct answer try67

What do you mean? Does it show the watermark when you open the file, even though you added the script? Where did you place it, exactly?


The same is happening to me... Maybe using this watermark is not the best option. It seems to be a bit problematic. You can remove it and use a button field, instead. Make the fill color transparent and set its label to "COPY". Then set its appearance to hidden and adjust the print code to the following (let's say the button is called "COPY"):

 

this.print();
this.getField("COPY").display = display.visible;
this.print();
this.getField("COPY").display = display.hidden;

 

That way you won't need to add any additional code to hide it when the file is opened.

Oh, and you can duplicate the button to all pages by right-clicking it (in Prepare Form mode) and selecting Duplicate Across Pages.

1 reply

try67
Community Expert
Community Expert
January 24, 2020

First, use the built-in Add Watemark command to create this watermark. Then, run this code to hide it from the JS Console:

this.getOCGs()[0].state=false;

 

Now, create your print button and use the following code as it's MouseUp action:

this.print();
this.getOCGs()[0].state=true;
this.print();
this.getOCGs()[0].state=false;

 

 

try67
Community Expert
Community Expert
January 24, 2020

PS. You might also want to add the first line of code as a doc-level script, to prevent the watermark from appearing when the file is first opened, since you can't change its initState property because it's a special OCG.

jojo121Author
Participating Frequently
January 24, 2020

You sir are a magician, thank you. 

 

Now i see it working it would be great if it could print directly instead of opening the print dialog. Is this possible?