Custom paper size with chrome-pdf



  • Hi,

    Is there any way to custom paper size with recipe chrome-pdf. I would like to have a PDF which will be 3 inches width by 1 in height.

    I tried to change size directly in the designer => no effects
    I tried to set it in script => no effects
    I tried to add phantam-pdf instead of chrome-pdf because many posts that i read talk this is the tool to customize paper size, but i was not able to get to it.

    I'm using nodejs version 16.14. I put you some pics to see what I'm trying to do.

    0_1700272662708_upload-2e918073-f5c6-40b9-b652-9491c5477544
    0_1700272717975_upload-4575441d-3b3c-4c69-8950-4a584f178340

    0_1700272879715_upload-6dad0056-215d-4c00-b80f-6ea056989687



  • The chrome property "format" has a higher priority than "width" and "height". So you just need to remove the "Letter" string from the "format" property. Like here
    https://playground.jsreport.net/w/anon/e5A6~y_k



  • Thank you for your answer, it helps me a lot. I already tried this solution first but there was an error that says unknown format then I realize it was not caused only by the size because I've copied an existing report and when I change the size of it, it cause the error. (script iterate in pages probably or something like that)

    So I decided to start a new one from scratch with the right dimension and everything is working well right now.

    Thanks


Log in to reply
 

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