job.getPath() can't find the file
Posted: Thu Dec 05, 2019 4:42 pm
I'am trying to run jar-file and it's working find if I'am not using variables like this
If I run the code below in SwitchScipter
or this code with getPath
I get the java error that it can't open the file.
If log sourceFile I get the correct path and I can see the pdf file in the folder.
How do I use the incoming file as the soruce file?
Code: Select all
var status = Process.execute("java -jar C:/pdfboxer.jar -trimBox 55.94803135054997,56.82283454999998,1164.1039372989,765.3543309 -sourceFile C:/myfile.pdf -destFile C:/trimmed.pdf");
Code: Select all
var status = Process.execute("java -jar " + scriptPath + " -trimBox " + startX + "," + startY + "," + xmlWidth + "," + xmlHeight + " -sourceFile " + sourceFile + " -destFile C:/trimmed.pdf");
Code: Select all
var status = Process.execute("java -jar " + scriptPath + " -trimBox " + startX + "," + startY + "," + xmlWidth + "," + xmlHeight + " -sourceFile " + job.getPath() + " -destFile C:/trimmed.pdf");
If log sourceFile I get the correct path and I can see the pdf file in the folder.
How do I use the incoming file as the soruce file?