Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Spawn different page templates from dropdown
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Spawn different page templates from dropdown

 Post Reply Post Reply
Author
smfrippon View Drop Down
New Member
New Member


Joined: 22 Aug 2018
Location: Leeds
Points: 3
Post Options Post Options   Quote smfrippon Quote  Post ReplyReply Direct Link To This Post Topic: Spawn different page templates from dropdown
    Posted: 22 Aug 2018 at 12:54pm
Hi I'm currently trying to make a pdf spawn different page templates based on the selections from a dropdown and I can't seem to get it to work:


I have the drop down named "Brief Type 3" containing 5 items with export values from 1-5. I also have a button to receive these values.


I have 5 page templates named 'spawn1', 'spawn2' 'spawn3' 'spawn4' 'spawn5'.


I'm using the following:


var sel = this.getField("Brief Type 3").value;



var templateName = "";

switch (sel) {

    case 1 : templateName = "spawn1";

        break;

    case 2 : templateName = "spawn2";

        break;

    case 3 : templateName = "spawn3";

        break;

    case 4 : templateName = "spawn4";

        break;

    case 5 : templateName = "spawn5";

        break;

}



if (templateName != "") {

    var t = this.getTemplate(templateName);

    t.spawn();

}


What am I doing wrong??


Any help would be greatly appreciated.


Thanks


Sam

Back to Top
Sponsored Links


Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1105
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 23 Aug 2018 at 10:36am
Use something like this:

t.spawn({nPage: event.target.page+1, bOverlay: false});
Back to Top
smfrippon View Drop Down
New Member
New Member


Joined: 22 Aug 2018
Location: Leeds
Points: 3
Post Options Post Options   Quote smfrippon Quote  Post ReplyReply Direct Link To This Post Posted: 05 Sep 2018 at 5:17pm
Thanks BAlheit, all sorted!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.016 seconds.