Search found 79 matches

by bkromer
Thu Oct 07, 2021 1:48 pm
Forum: LEGACY scripting
Topic: Write PDF from base64-String
Replies: 1
Views: 2373

Re: Write PDF from base64-String

Okay that was dumb I just found the solution... I need to use "fromBase64" instead of "utf-8".

Code: Select all

var ba = new ByteArray( base64Label, "fromBase64");
by bkromer
Thu Oct 07, 2021 1:44 pm
Forum: LEGACY scripting
Topic: Write PDF from base64-String
Replies: 1
Views: 2373

Write PDF from base64-String

I get a PDF as bases64 and just need to write a pdf from that. How can I make this in a Legacy Script? My code so far: function jobArrived( s : Switch, job : Job ) { const base64Label = "JVBERi0xLjQKJeLjz9MKMyAwIG9i............"; const path = job.createPathWithName("DPDLabel.pdf"); var ba = new Byte...
by bkromer
Tue Jul 27, 2021 8:41 am
Forum: LEGACY scripting
Topic: How to parse XML Response from Chili Publish API in Switch Legacy Scripter
Replies: 2
Views: 2336

Re: How to parse XML Response from Chili Publish API in Switch Legacy Scripter

I tried this with the Chili Publish Flow Element and action documentCreatePDF. ATM it's not working. Chili Support works on this ticket. We haven't updated switch. Because it's risky and we ain't got the time and capacity to fix everything of those old flows. Thanks Freddy.👍🏻 I will use a Nodejs ser...
by bkromer
Mon Jul 26, 2021 8:11 pm
Forum: LEGACY scripting
Topic: How to parse XML Response from Chili Publish API in Switch Legacy Scripter
Replies: 2
Views: 2336

How to parse XML Response from Chili Publish API in Switch Legacy Scripter

Hey folks,

how can I parse the XML from a "theHTTP.getServerResponse()"-string.
Looks like this. So need to enter the "key" element. "<apiKey succeeded="true" key="MYNEWAPIKEY" validTill="2021-07-27 03:56:15Z" superAdmin="false" />"

Is there no parse function like there is one for JSON.parse() ?
by bkromer
Tue May 04, 2021 11:00 pm
Forum: LEGACY scripting
Topic: How to POST a file to an API (Content-Type: multipart/formdata)
Replies: 9
Views: 9378

Re: How to POST a file to an API (Content-Type: multipart/formdata)

Cant find a Documentation for that API. Can you provide some more information on Müller Martini Connex?
rgpepper wrote:
Tue May 04, 2021 7:23 pm
...I need to do this without scripting....
Why :?:
by bkromer
Thu Apr 22, 2021 7:42 am
Forum: LEGACY scripting
Topic: Get E-Mails as .eml?
Replies: 1
Views: 1120

Get E-Mails as .eml?

Is it possible to write a Script to connect to a pop3 and get new mails and save it as ".eml"?
by bkromer
Thu Apr 22, 2021 7:34 am
Forum: Switch
Topic: Receive E-Mails as ".eml" possible?
Replies: 1
Views: 1135

Receive E-Mails as ".eml" possible?

Hi there,

as far as I know when using the incoming E-Mail Node we receive a Folder with a txt or when specified the attachments

Is it somehow possible to receive the E-Mail itself as ".eml"?

Thanks in Advance for any hint.
by bkromer
Thu Dec 10, 2020 3:15 pm
Forum: LEGACY scripting
Topic: Merge two text files
Replies: 2
Views: 2649

Merge two text files

Hello, I need to run a OCR on PDF Files. I want to use Tesseract. Tesseract need pictures so I build a Flow to convert PDF to JPEG and read them with OCR. Tesseract spits out txt files. I then want to read in those text Files in my script and use RegEx to sort them by specific identifiers and finall...
by bkromer
Fri Nov 20, 2020 10:59 am
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 10329

Re: Select a file from the beginning of a flow

Okay this worked for me now:

Code: Select all

var dataset = job.getDataset( "OpaqueJson"  );
var jsonFilePath = dataset.getPath();
var jsonFileObj = File.read( jsonFilePath ,'utf-8'); 
var orderJson = JSON.parse( jsonFileObj );
Bildschirmfoto 2020-11-20 um 10.57.22.png
Bildschirmfoto 2020-11-20 um 10.57.22.png (83.66 KiB) Viewed 3640 times
The attachment Bildschirmfoto 2020-11-20 um 10.57.22.png is no longer available
by bkromer
Fri Nov 20, 2020 10:25 am
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 10
Views: 6234

Re: DPD SOAP API

We've been integrating with DPD as well (Portugal), and it will be different, but maybe some of this can be helpful. DPD Portugal still doesn't have a REST API, as far as I know, so we've been using SOAP as well. We ended up using a script (still legacy) to build the XML file, according to the docu...
by bkromer
Fri Nov 20, 2020 9:41 am
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 10329

Re: Select a file from the beginning of a flow

So you mean the Flow Element "Export Metadata"? So I cant use job.getVariableAsString( '[Metadata.Rational:Path="Opaque"] ')? In My Flow I get a JSON from a WebHook within the JSON is the name of the PDF-File I want to print via "Flux Server API" and various information for the job. So I need the PD...
by bkromer
Fri Nov 20, 2020 9:07 am
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 10329

Re: Select a file from the beginning of a flow

Is there a way to "File.read()" a File thats not in the actual Job-Folder of the Script? How can I refer to such a file? For Example the JSON file is in Folder 11 how can I read it by refering to it like File.read('Ordner 11/filename.json')!?
by bkromer
Thu Nov 19, 2020 9:09 am
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 10329

Re: Select a file from the beginning of a flow

You renamed the payload file and also changed the extension. The filename before the extension must be alike but different extensions. The filetype you want to embed as an opaque datatype i specified in the properties. You you need two files as this: myfilename.pdf and myfilename.json okay thanks. ...
by bkromer
Mon Nov 16, 2020 9:40 am
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 10329

Re: Select a file from the beginning of a flow

jan_suhr wrote:
Sun Nov 15, 2020 1:52 pm
...
So you have to find a way to rename the payload file.
Is it not enough to rename one of the files? Image
They still have their unique filename for a second.
by bkromer
Sun Nov 15, 2020 1:26 pm
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 10329

Re: Select a file from the beginning of a flow

jan_suhr wrote:
Sun Nov 15, 2020 11:05 am
Do both files have the same name?
No its 470_payload.json and 127398.pdf as u can see on the screenshot.