Search found 506 matches

by freddyp
Thu Aug 06, 2020 7:24 pm
Forum: LEGACY scripting
Topic: Rename XML file with PDF file name
Replies: 1
Views: 39

Re: Rename XML file with PDF file name

Put the two files in a folder and in "XML Pickup" use "Pickup mode - Metadata in job folder asset". The name of the XML does not matter in that case. How do you get the two files in a folder? "Assemble job" with "Scheme - Custom" and "Number of files - 2". How do you make sure it is the correct two ...
by freddyp
Tue Aug 04, 2020 10:35 am
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 9
Views: 405

Re: DPD SOAP API

Whether you have to POST or GET are things you have to find in the DPD documentation. SOAP API's generally use POST, but GET is technically allowed. Also the content of the HTTP headers you have to send is something you will find there. Whether you have to upload a file (setAttachedFile) or place th...
by freddyp
Tue Aug 04, 2020 10:35 am
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 9
Views: 405

Re: DPD SOAP API

Whether you have to POST or GET are things you have to find in the DPD documentation. SOAP API's generally use POST, but GET is technically allowed. Also the content of the HTTP headers you have to send is something you will find there. Whether you have to upload a file (setAttachedFile) or place th...
by freddyp
Mon Aug 03, 2020 11:08 am
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 9
Views: 405

Re: DPD SOAP API

When you read in the documentation that something is a constructor: SOAP ( in-path : String ) Constructs a new SOAP request and reads the SOAP envelope from the specified XML file. then the usage is: var soapRequest = new SOAP(inPath); whereby inPath is not job.getPath(), but the path to the XML tha...
by freddyp
Fri Jul 31, 2020 9:22 am
Forum: Flows
Topic: [SOLVED]Using Switch for automatic OCR recognition?
Replies: 11
Views: 257

Re: Using Switch for automatic OCR recognition?

Tesseract was also the first thing that sprang to my mind. Ingenious scripting? Tesseract is a command line tool, so you can integrate it with "Execute command". If the options are always the same, and I would think they probably are, you do not need a script. If the choice of options is more involv...
by freddyp
Fri Jul 31, 2020 9:15 am
Forum: Flows
Topic: find job repository by variable
Replies: 3
Views: 204

Re: find job repository by variable

It is always a good idea to have a look in the Enfocus Appstore. This app will probably solve your problem:
https://www.enfocus.com/en/appstore/pro ... t-wildcard
by freddyp
Mon Jul 27, 2020 9:09 am
Forum: Flows
Topic: Execute Command not Finding LaTex shell command
Replies: 3
Views: 209

Re: Execute Command not Finding LaTex shell command

You have to realize that the Switch Server process that is running in the background is NOT running in the same environment as the one that is used one the command line (either a command prompt window on Windows, or Terminal on Mac). One of the big differences is the PATH environment variable. This ...
by freddyp
Fri Jul 17, 2020 2:01 pm
Forum: Preflighting
Topic: Actions & Preflights
Replies: 4
Views: 537

Re: Actions & Preflights

I thought you were doing something in an Action List inside the preflight profile for checking the presence of layers because the "Document has layers" check that you use in the preflight profile checks for the presence of layers, however many. There is your problem. As to the solution, I have attac...
by freddyp
Thu Jul 16, 2020 8:31 pm
Forum: Preflighting
Topic: Actions & Preflights
Replies: 4
Views: 537

Re: Actions & Preflights

I cannot immediately explain this, I would have to see all the action lists and the order in which they are performed. Perhaps the file itself is also necessary. But before digging too deep, try out this much simpler approach: use the "Rename layer" action.
by freddyp
Mon Jul 13, 2020 12:52 pm
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 9
Views: 405

Re: DPD SOAP API

Using SOAP is not that different. Instead of building a JSON you have to build an XML and post that and the result will of course also be XML and not JSON. That makes it sound easy, but unfortunately that is not always the case. There is usually a WSDL file (this is in XML) that describes everything...
by freddyp
Mon Jul 13, 2020 12:06 pm
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 9
Views: 405

Re: DPD SOAP API

SOAP is sometimes referred to as "XML over HTTP". There is nothing you can do with the SOAP class that you cannot do with the HTTP class, but the reverse is not true!! In the HTTP class you can manipulate the headers of the request for example, something that is not possible in the SOAP class. The S...
by freddyp
Tue Jul 07, 2020 4:02 pm
Forum: LEGACY scripting
Topic: Upload Files as Base 64 encoded Strings to API
Replies: 3
Views: 180

Re: Upload Files as Base 64 encoded Strings to API

Code: Select all

var pdf =  File.read( job.getPath(), "utf-8" );
reads the PDF as a string. Afterwards you convert it to a ByteArray, but then the damage is already done. You can read the file directly as a ByteArray:

Code: Select all

var pdf =  File.readByteArray( job.getPath());
by freddyp
Tue Jul 07, 2020 2:09 pm
Forum: Node.js scripting
Topic: New scripting engine in Switch 2020
Replies: 9
Views: 1204

Re: New scripting engine in Switch 2020

Correct, you always need to test your Node script via a flow. You can, however, attach the script in the flow with the debugger in VSCode. These are the steps. In VSCode: Run - Add configuration. This requests to select an environment from a dropdown list. Choose "Node.js". This will create a launch...
by freddyp
Tue Jul 07, 2020 1:06 pm
Forum: LEGACY scripting
Topic: Access Switchscripter error in mail body (next module)
Replies: 1
Views: 113

Re: Access Switchscripter error in mail body (next module)

job.fail takes the job to Problem jobs. When working with a traffic-light output you have to use job.sendToData( 1/2/3, job.getPath()); Where 1 takes it to success, 2 to warning and 3 to error. And as to putting the error messages in the mail body: job.appendEmailBody("Process shipment marking faile...
by freddyp
Wed Jun 17, 2020 11:47 am
Forum: PitStop Server
Topic: Split PDF layers
Replies: 5
Views: 612

Re: Split PDF layers

The syntax for specifying layer names is simply that you place one layer name on one line. If the layer name is fixed, you just type it. If the layer name is a variable you click on the button to open the variables dialog and it will get inserted on a line. If you want to get the layer names from th...