Set chrome-image template clip height in request properties or beforeRender script?



  • I have a chrome-image template that I am rendering and I want to clip the height of the image based on the number of rows of data that end up in the image. Is there a way to specify a custom clip height in the request to the template or in a beforeRender script? I can't have it be a static value like the UI wants.

    Thanks!



  • It is the same as for any other template property. The props send in the API requests are overriding the props saved in the template itself.

    { "template": { "name": "foo", "chromeImage": { "clipWidth": 2 } } }
    

    You can see the prop names if you open F12 tools during rendering and inspect the network when running request in studio.



  • Thanks! I wasn't aware that the template properties worked this way.


Log in to reply
 

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