Home
 
The page you are viewing is part of our 160,000 page PDF discussion forum archive spanning 1999-2011.
Go to the new Planet PDF forum to join the PDF community.
 

Search
 Advanced   
Sign up for a WebBoard account Archive Forum Home


PLATINUM
SPONSOR

GOLD
SPONSORS



Topic  
Go to previous topicPrev TopicGo to next topicNext Topic
Author Message
mheintz
mheintz

Total Messages 4

Subject:Sequential Numbering

I am trying to print out a sequence of serial numbers, a different number on each page. If I default to starting with 1, the following script works fine.

//---> start code
// get number of forms to print
//var StartNumber=app.response({cTitle: "Start Number", cQuestion: "Enter the starting serial number:", cDefault:1, cLabel:"First Number:"});
var EndNumber=app.response({cTitle: "End Number", cQuestion: "Enter the ending serial number:", cDefault:1, cLabel:"Last Number:"});
//print the forms
var i=1; // counter for forms printed
// loop while the counter "i" is less than the number of forms to print
do {
this.getField("Serial").value = i;
this.print({bUI:false, nStart: 0, bSilent: true});
i=i+1;
} while(i <= EndNumber);
//---> end code

However if I turn on the StartNumber and make Var i=StartNumber so I can print a range that doesn't start with 1, the serial numbers I get are 002, 021, etc. for 2-3 and the prints keep coming (I get something similar if I select from 1-2: 001, 011, 111, etc.). My Serial field is set up to be 3 characters with leading zeroes. Any suggestions?


Posted: 11 Sep 2009 03:30 AM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
jkitzy
jkitzy

Total Messages 94

Subject:Sequential Numbering

A lot of times, javascript has a hard time distinguishing between numbers and alphanumeric.

A good rule of thumb is to multiply the results by 1 to force it to recognize your numbers. i.e.
----------------------------------------------
var EndNumber=app.response({cTitle: "End Number", cQuestion: "Enter the ending serial number:", cDefault:1, cLabel:"Last Number:"});
EndNumber = EndNumber * 1;

---jak


Posted: 12 Sep 2009 12:17 AM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
mheintz
mheintz

Total Messages 4

Subject:Sequential Numbering

Thanks for your help. That did it.


Posted: 12 Sep 2009 12:29 AM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
   
Go to previous topicPrev TopicGo to next topicNext Topic

go




Top | News | Developer | Find PDF Tools | Sponsorship | Tips | Home



Debenu's Planet PDF - a comprehensive site exclusively focused on Adobe Acrobat/PDF users and uses. Debenu's Planet PDF - Resources for Adobe Acrobat and PDF users

Please post PDF-related questions to our Planet PDF Forum forums.planetpdf.com. To send comments about this site please visit our contact page.
Planet PDF, Planet PDF Forum, PDF SDK - Debenu Quick PDF Library and Debenu are all copyright
© 2011 Debenu Pty Ltd.. All Rights Reserved. Privacy policy.