Print Page | Close Window

Spawn different page templates from dropdown

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 17 Jul 2019 at 1:34pm
Software Version: Web Wiz Forums 11.10 -

Topic: Spawn different page templates from dropdown
Posted By: smfrippon
Subject: Spawn different page templates from dropdown
Date 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";


    case 2 : templateName = "spawn2";


    case 3 : templateName = "spawn3";


    case 4 : templateName = "spawn4";


    case 5 : templateName = "spawn5";



if (templateName != "") {

    var t = this.getTemplate(templateName);



What am I doing wrong??

Any help would be greatly appreciated.



Posted By: BAlheit
Date Posted: 23 Aug 2018 at 10:36am
Use something like this:

t.spawn({nPage:, bOverlay: false});

Posted By: smfrippon
Date Posted: 05 Sep 2018 at 5:17pm
Thanks BAlheit, all sorted!

Print Page | Close Window

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