Forum How do I...?

Prince Control Protocol - could not read chunk for job chunk

HadrienG
Hello ! I'm trying to use Prince Control Protocol but I can't get my head around it.

Whether I specify "job" or not, with absolute path or local path, I always end up with the same error "err 20
could not read chunk".

An example of my test is (where "xxx" is my path to file) :

prince --control

ver 11
Prince 14.4
job { "input": { "src": "xxx/index.html" }, "job-resource-count": 0 } }
err 20
could not read chunk

Is there something I'm missing ?

Thanks princers

mikeday
Chunks begin with a line containing a three letter tag followed by a space and then the number of bytes in the chunk as a decimal number followed by a newline and then the chunk data, which you can see in the example above with the "ver 11" (a version chunk of eleven bytes) and "err 20" (an error chunk of twenty bytes).

So your example would need to be "job NN" on one line where NN is the number of bytes in the JSON string that follows.

You can check the Prince Java and C# wrappers for examples of using the Prince control protocol, or just use them directly.
HadrienG
Thanks a lot mikeday, works like a charm with your explanation.