Printing Number of Copies in same PDF



  • We have settings where user can enter the number of copies to printed in same PDF.
    Is it possible in JS Report ?
    If so ! please suggest us an idea .



  • Yes! You can use scripts and pdf utils extensions to achieve that. Here is the demo
    https://playground.jsreport.net/w/anon/46DGGc62

    And here the documentation
    https://jsreport.net/learn/scripts
    https://jsreport.net/learn/pdf-utils



  • After Implementing the scripts , it throws an error like

    Error: Invalid PDF: startxref not found
    at process.<anonymous> (E:\V2\jsReport\node_modules\script-manager\lib\worker-processes.js:55:23)
    at process.emit (events.js:200:13)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)

    And the following is our jsreport.config file

    {

    "allowLocalFilesAccess": true,
    "store": {
        "provider": "fs"
    },
    "blobStorage": {
        "provider": "fs"
    },
    "templatingEngines": {
        "timeout": 600000
    },
    "chrome": {
        "timeout": 600000
    },
    "extensions": {
        "authentication" : {
            "cookieSession": {
                "secret": "<your strong secret>"
            },
            "admin": {
                "username" : "admin",
                "password": "password"
            },
            "enabled": false
        },
        "sample-template": {
            "createSamples": true
        },
        "scripts": {
    	"allowedModules": "*",
         "timeout": 30000
        },
    	"express": {
            "inputRequestLimit": "200mb"
        },
    	"fs-store": {
       "syncModifications": false
    }
    }
    

    }



  • Please share a playground demo or export zip so we can analyze it.



  • Working fine now.
    Thanks !! :-)



  • Hi, I'm getting the same error, do you mind sharing the solution. Thanks in advance


Log in to reply
 

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