Skip to main content
Inspiring
January 30, 2024
Question

Form Issue with Spawn Pages on Mac vs. Windows

  • January 30, 2024
  • 3 replies
  • 967 views

Hi everyone,
I would like your guidance, please. I have built a form that includes a Spawn pages. When the user ticks the box, the code below should run and aggregate the pages. It works fine in Acrobat Reader on Windows, but on Mac, it doesn't work (when the box is ticked, nothing happens). Any idea why? and if there is any solution please
Thanks a lot
--------------------------
var checkbox = this.getField("Reader");

if (numPages > 1) {
var confirmed = app.alert({
cMsg: "Are you sure you want to uncheck the box? This will delete your current form.",
cTitle: "Confirmation",
nIcon: 2,
nType: 2,
});

if (confirmed == 4) {
event.target.value = "";
this.deletePages(1, this.numPages - 1);} else {
event.target.value = "Yes";
}
} else {
if (event.target.value !== "Off") {
this.getTemplate("Page2").spawn(1, false, false);
this.getTemplate("Page3").spawn(2, false, false);
this.getTemplate("Page4").spawn(3, false, false);
this.getTemplate("Page5").spawn(4, false, false);
this.getTemplate("Page6").spawn(5, false, false);
}
}

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
January 31, 2024

In which trigger did you place this script?

 

However, I think you're complicating things unnecessarily and that the alert is useless: if the user deletes the pages by mistake, all he has to do is tick the checkbox again to respawn them. And as the fields are all duplicates in hidden templates, they will remain filled in and no data will be deleted.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
January 31, 2024

You must first ensure that Mac users open this form with Acrobat, and not with Preview (which poorly supports PDF features).

Acrobate du PDF, InDesigner et Photoshopographe
KaxkulAuthor
Inspiring
January 31, 2024

Thank you, @JR Boulay , but yes, the user downloaded Acrobat Reader, and it still didn't work. This is why I was wondering why.

try67
Community Expert
Community Expert
January 31, 2024

There's no reason this code should work on Windows and not on a Mac. What exactly happens when they try to use it? Ask them for a full description of the issue, with full-window screenshots. My bet is they're not opening it in Adobe Reader, even if they think they are.

JR Boulay
Community Expert
Community Expert
January 31, 2024

[MOVED TO THE ACROBAT PRO DISCUSSIONS]

Acrobate du PDF, InDesigner et Photoshopographe