Using pdf-utils with executable CLI



  • Hi

    I'm trying to use merge and append operations in pdf-utils with the windows executable, but I can't seem to figure out how reference a seperate, local file for the content. Usually this would be done by storing separate template and referencing them by their 'Shortid', but I'm not sure how you would approach that with the with the executable/CLI-tool.

    I've tried simply creating a new "stateless" template instead of referencing a stored template, but it's getting quite complex for its size.

     pdfOperations: [{
         "type": "merge",
         "template": {
            "content":
            ...
         } 
    }]
    

    Thanks,

    Morten


  • administrators

    hi!

    if you are using the windows executable it makes me think that you are using the render command and trying to pass these values in a json file specified in a argument for the command. is that correct? can you be more specific about how are you trying to pass these values? try to describe the exact steps that you are using so we get a better idea if what you are trying is good or not.

    Usually this would be done by storing separate template and referencing them by their 'Shortid', but I'm not sure how you would approach that with the with the executable/CLI-tool.

    you can create a jsreport.config.json file next to your executable, in that file you can configure the executable to store things on your file system by using { "store": { "provider": "fs" } }. then you just need to start the executable by using jsreport.exe start, open studio, and create your templates and save them, everything you do there should be saved in your file system now, so the next time you start the executable your previous templates will be there.

    with that in mind you can take the shortid of one of your stored templates and use it normally in your pdf utils options.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.