PageWidth how to assign a value to a variable?
PageWidth how to assign a value to a variable?
PageWidth how to assign a value to a variable?
How to use PageWidth variable in JavaScript?
How to use PageWidth variable in JavaScript?
PageWidth how to assign a value to a variable?
var pageWidth = job.getVariableAsNumber("[Stats.PageWidth]");
PageWidth how to assign a value to a variable?
Really worked, thank you very much.
PageWidth how to assign a value to a variable?
var re =job.getPath();
re=re.mid(0,re.findRev("/")) + "/"+job.getName();
var curFileStats = new FileStatistics(re);
currentbook = curFileStats.getNumber("PageWidth");
why can't work?
re=re.mid(0,re.findRev("/")) + "/"+job.getName();
var curFileStats = new FileStatistics(re);
currentbook = curFileStats.getNumber("PageWidth");
why can't work?
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
PageWidth how to assign a value to a variable?
Is your job a file or folder?
PageWidth how to assign a value to a variable?
dkelly wrote: Is your job a file or folder?
my job is a file.
my job is a file.
PageWidth how to assign a value to a variable?
how to use function FileStatistics?
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
PageWidth how to assign a value to a variable?
If your job is a single file use:
var curFileStats = new FileStatistics(job.getPath());
currentbook = curFileStats.getNumber("PageWidth");
var curFileStats = new FileStatistics(job.getPath());
currentbook = curFileStats.getNumber("PageWidth");
PageWidth how to assign a value to a variable?
dkelly wrote: If your job is a single file use:
var curFileStats = new FileStatistics(job.getPath());
currentbook = curFileStats.getNumber("PageWidth");
I tried, but without success.
Can you give me an example of flow?
test.sflow
var curFileStats = new FileStatistics(job.getPath());
currentbook = curFileStats.getNumber("PageWidth");
I tried, but without success.
Can you give me an example of flow?
test.sflow
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
PageWidth how to assign a value to a variable?
Your script doesn't follow the example I gave. You are not using the FileStatistics variable curFileStats to retrieve the PageHeight.
PageWidth how to assign a value to a variable?
dkelly wrote: Your script doesn't follow the example I gave. You are not using the FileStatistics variable curFileStats to retrieve the PageHeight.
return value:undefined
return value:undefined
PageWidth how to assign a value to a variable?
dkelly wrote: Your script doesn't follow the example I gave. You are not using the FileStatistics variable curFileStats to retrieve the PageHeight.
return value:undefined
Does anyone know what is the reason?
return value:undefined
Does anyone know what is the reason?
PageWidth how to assign a value to a variable?
The return value of a script expression is the "last" variable on a line of its own.
var result = "1";
result;
If the script expression is more than just one or two lines I recommend to structure it as follows: create a function that returns a value and call that function on the last line of your script expression. You do not have to do it like this, but it is generically applicable.
function someFunction(par1, par2)
{
var returnValue;
//perform stuff that gives returnValue the correct value
return returnValue;
}
someFunction("first parameter",second_parameter);
Freddy
var result = "1";
result;
If the script expression is more than just one or two lines I recommend to structure it as follows: create a function that returns a value and call that function on the last line of your script expression. You do not have to do it like this, but it is generically applicable.
function someFunction(par1, par2)
{
var returnValue;
//perform stuff that gives returnValue the correct value
return returnValue;
}
someFunction("first parameter",second_parameter);
Freddy
PageWidth how to assign a value to a variable?
freddyp wrote: Freddy
Theresult of this variable is not important, the key is currentbook which returned the result is undefined. I want this currentbook value equals pdf's PageHeight.
Theresult of this variable is not important, the key is currentbook which returned the result is undefined. I want this currentbook value equals pdf's PageHeight.
PageWidth how to assign a value to a variable?
Then just write
currentbook;
as the last line of your script expression. I thought that was clear from the explanation.
Freddy
currentbook;
as the last line of your script expression. I thought that was clear from the explanation.
Freddy