Search found 50 matches

by Sunnyland
Mon May 10, 2021 1:40 am
Forum: Node.js scripting
Topic: API issues
Replies: 4
Views: 993

Re: API issues

Thanks Freddy, that really helps. I have metadata but it is read only so I didn't bother to specify and the sample I am showing the field names are incorrect so that id why I would be getting the error message. I don't need the metadata it is only there to help debug so will turn off for now. Thanks...
by Sunnyland
Wed May 05, 2021 12:20 am
Forum: Node.js scripting
Topic: API issues
Replies: 4
Views: 993

Re: API issues

Hi Freddy, I used the job id as returned in the List Jobs call. I also get the connection number from the List Jobs call. The weird thing is that it was working in the 2019 version. I stopped using for a while as I rebuilt some flows during which I upgraded from 2019 to 2020. Now I cannot get the ap...
by Sunnyland
Tue May 04, 2021 10:23 am
Forum: Node.js scripting
Topic: API issues
Replies: 4
Views: 993

API issues

Hi There, I am currently using the switch api to push through jobs but unfortunalty they are not moving to the next connection. I am using the Job - Route method PUT http://127.0.0.1:51088/api/v1/job/:id?action=route and getting a Success 200 response as below "status": true, "data": "http://myurl:5...
by Sunnyland
Mon May 03, 2021 2:23 am
Forum: Flows
Topic: Sorting and duplicating pages in PDF
Replies: 4
Views: 2266

Re: Sorting and duplicating pages in PDF

Thanks for the reply's sorry I have taken so long to respond. Both idea's are great but I think the major stumbling block is figuring out if the back page is the first or last page in the PDF. I have Callas and Pitstop Server depending on what I need to do. Was thinking maybe using a Text reader and...
by Sunnyland
Thu Apr 08, 2021 6:00 am
Forum: Node.js scripting
Topic: Help with CSV Split
Replies: 5
Views: 1156

Re: Help with CSV Split

Thanks for your help. Below is my final code to split a CSV file and group by the id field. const fs = require('fs-extra'); const fastCsv = require('fast-csv'); const { pipeline } = require('stream') async function jobArrived(s, flowElement, job) { const options = {headers: true, delimiters: ','}; /...
by Sunnyland
Wed Apr 07, 2021 12:18 am
Forum: Node.js scripting
Topic: Help with CSV Split
Replies: 5
Views: 1156

Re: Help with CSV Split

Thanks Freddy, yes I was getting output. At this stage I wasn't too concerned about passing the files back into the flow I just needed the separated CSV files which I had writing to a temp location. The main problem was that the promise was completing before fastcsv would finish writing the new file...
by Sunnyland
Wed Apr 07, 2021 12:18 am
Forum: Node.js scripting
Topic: Help with CSV Split
Replies: 5
Views: 1156

Re: Help with CSV Split

Thanks Freddy, yes I was getting output. At this stage I wasn't too concerned about passing the files back into the flow I just needed the separated CSV files which I had writing to a temp location. The main problem was that the promise was completing before fastcsv would finish writing the new file...
by Sunnyland
Mon Apr 05, 2021 1:45 pm
Forum: Node.js scripting
Topic: Help with CSV Split
Replies: 5
Views: 1156

Help with CSV Split

I have a large CSV file which I want the split into kinds. The file has id's (packNrs) I would like to split using these values. At this stage I have found code that allows me to split on these values but my issue is witting the new CSV files basically I am only get one row written before the next f...
by Sunnyland
Sun Jan 17, 2021 10:49 pm
Forum: Node.js scripting
Topic: api call from flow
Replies: 6
Views: 2278

Re: api call from flow

This is what the above code looks with these changes. const querystring = require('querystring'); const http = require("http"); const XPath = require("xpath"); const fs = require("fs-extra"); const DomPaser = require("xmldom").DOMParser; async function jobArrived(s, flowElement, job) { let jobName =...
by Sunnyland
Sun Jan 17, 2021 10:42 pm
Forum: Node.js scripting
Topic: api call from flow
Replies: 6
Views: 2278

Re: api call from flow

Hi Foxplace, This is the code I used to send the SOAP request and to return as a promise. const options = { hostname: nURL.hostname, port: 443, path: path, method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': data.length, 'Host' : nURL.hostname } } return...
by Sunnyland
Mon Nov 30, 2020 11:01 pm
Forum: Applications
Topic: HP SmartStream VDP
Replies: 11
Views: 12590

Re: HP SmartStream VDP

Sorry to reopen an old post but I am trying to use the HP VDP with indesign 2019. I have installed The Adobe Extension toolkit for CC but I get an error in the log file stating that it only works with indesign version 5 or later. I just have one job that comes in every 3 months, not a big deal if I ...
by Sunnyland
Fri Oct 02, 2020 9:17 am
Forum: Node.js scripting
Topic: api call from flow
Replies: 6
Views: 2278

Re: api call from flow

Thanks Freddy, Yep big learning curve with NodeJS, using callback or Promises. I really had to drill down on what the differences are. I have change the above code and now it uses promises and not callbacks and believe it or not the code is much simpler and now works. Will look forward to the webinar.
by Sunnyland
Wed Sep 16, 2020 8:55 am
Forum: Node.js scripting
Topic: Writing a Dataset JSON
Replies: 2
Views: 1481

Re: Writing a Dataset JSON

Thanks for the info,
I also realized that I have set the datasetmodel set to JDF rather than JSON which didn't help my cause. I will convert to XML just try to take the easy way out.
by Sunnyland
Wed Sep 16, 2020 8:31 am
Forum: Node.js scripting
Topic: Writing a Dataset JSON
Replies: 2
Views: 1481

Writing a Dataset JSON

So I want to write a JSON dataset. Using await job.createDataset("iqdata",JSONpath,DatasetModel.JDF); and writing this JSON Data { "job": [{ "impositionwidth": "210.0000", "impositionheight": "297.0000", "sectionnumber": 0, "finishedwidth": "210.0000", "finishedheight": "297.0000", "pages": "2", "fo...
by Sunnyland
Tue Sep 01, 2020 10:14 am
Forum: Node.js scripting
Topic: api call from flow
Replies: 6
Views: 2278

api call from flow

I am currently trying to make an api call from a flow. I already have a script that works using Javascript but for this I have decided to put my poor NodeJs skills to the test and see how I go. I have failed so far, it appears that the http code is just ignored by switch. I do not get success logs o...