That's great news, we'll keep an eye out for that version!
Thanks for the clarification on what the valid values are, the documentation wasn't clear.
That's great news, we'll keep an eye out for that version!
Thanks for the clarification on what the valid values are, the documentation wasn't clear.
Hello, I'm trying to get a pdf that will not allow any editing. I don't want the user to have to enter a password.
Per the https://jsreport.net/learn/pdf-utils documentation I supplied:
{
"template": {
"name": "directoryTemplate",
"engine": "pug",
"recipeArgs": {
"format": "Letter",
"marginRight": "0",
"marginLeft": "0",
"marginTop": "0",
"marginBottom": "0"
},
"recipe": "chrome-pdf",
"pdfPassword": {
"ownerPassword": "password",
"printing": "high resolution",
"modifying": false,
"copying": false,
"annotating": false,
"fillingForms": false,
"contentAccessibility": false,
"documentAssembly": false
}
},
"data": {
...snip...
}
}
This makes the pdf not editable (good!) but it also disallows printing (not good...).
For the "printing" field, I also tried "HighResolution" per the example in the documentation and "highResolution" after poking around in https://github.com/jsreport/jsreport-pdf-utils for a bit (though that looks just like the UI for the studio part).
We have created pdfs via a different platform that are not editable and that are printable so I know it is technically possible and per the listed pdf specification, it's a matter of getting the correct bits set for user access permissions. Given that, are any of these the correct value for the printing field? Am I missing something else to get the correct bits to be set to allow printing but not editing?
We are using the 2.10.0-full version of the docker image.
Bump, we are having trouble with this as well. We'd like the pdf to be able to be opened by anyone, but a tool will not allow changes to the pdf itself, either by protecting with a password, or otherwise just not allowing the edits.
Our request has the following:
{
"template" : {"name":"directoryFourColumnTemplate","pdfPassword":{"active":false,"ownerPassword":"1234","protectionLevel":3}}
"data" : ...
}
We are using the jsreports docker image jsreport:2.5.0-full
When the pdf is rendered I can still edit the document, when I believe that protection level 3 should be print only. I am not sure how to get an example in the playground since it doesn't seem to have a way to make the request with the pdf-password extension?
Oh thanks! I did not manage to search for the right thing to get the string interpolation info. I appreciate your time!
Hello, we upgraded from 1.9.2 (with jade and electron-pdf) to 2.5 (switched to pug and electron-pdf) recently and our images are no longer rendering. We have dynamic base64 strings that are placed into image tags. Here is a snippet of the template:
if (frontMatterPages)
each frontMatterPage in frontMatterPages
.page
.page-header
.page-content(style="text-align: center")
br
br
if frontMatterPage.base64
img(src="data:image/png;base64, #{frontMatterPage.base64}" width="95%" height="auto")
I made an example in the sandbox. The base64 string is the same, but when used as a variable it doesn't work:
https://playground.jsreport.net/w/fizzofdeath/gKHp3D6Y
In the example, the first image does not render, but the second does. Is there some syntax change that I'm missing to put variables in the image tag?
Thanks!
The full docker container is much better! The timeouts have stopped and while I know there might still be some instability there, it's probably enough for now. I'm also trying to do the volume mapping properly, but am getting an error. I think it makes more sense to start a new post about that after I've gathered up the error message and written it up a bit.
I'd be interested in checking out the beta with the chrome headless recipe. Can you tell me how/where to get the beta version when it's ready to start looking at?
Oh, I had not seen the full image. I will try that out to see if that makes a difference.
Hello,
I'm attempting to run jsreport in a docker container as a dependency for a dockerized microservice. I'm getting a timeout when using electron-pdf as the recipe. I have tried bumping the timeout for electron up to as much as five minutes and it still times out.
I saw a post from 6 months ago that suggested electron-pdf is unstable in certain situations. I was wondering if this might be the same and if there were any updates to this or the potential headless chrome as another option. Retry logic was alos suggested but I haven't been able to generate a pdf even trying multiple times.
We've looked into other recipes, like phantom-pdf and wkhtmltopdf, but electron-pdf best fits our needs for certain features.
Here are some details:
Debug logging:
Error occured - Error during rendering report: Timeout when executing in electron
logs:
+0 Starting rendering request 1
+1 Rendering template {shortid:liz, recipe:electron-pdf, engine:jade, preview:true}
+1 Data item not defined for this template.
+7 Resources not defined for this template.
+8 Base url not specified, skipping its injection.
+9 Rendering engine jade
+240 Compiled template not found in the cache, compiling
+255 Replaced images []
+257 Executing recipe electron-pdf
Stak - Error: Timeout when executing in electron
at Timeout._onTimeout (/usr/src/app/node_modules/electron-html-to/lib/dedicatedProcessStrategy.js:272:20)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
Because the base jsreport image didn't work out of the box for jade/electron I created a dockerfile in order to build a jsreport image:
From jsreport/jsreport
RUN npm install jsreport-jade@2.0.1
RUN npm install jsreport-electron-pdf npm install electron
I'm running this container via docker-compose, but it is reproducible via:
docker run -p 5488:5488 -v <local templates folder>:/usr/src/app/data/templates <local image name>:latest
The template content is in a folder in the local templates folder and the content.jade file contains:
.page
.page-header
.page-content(style="text-align: center")
b hello world
And the template config.json:
{
"shortid": "12345",
"recipe": "electron-pdf",
"engine": "jade",
"modificationDate": {
"$$date": 1522176393572
},
"_id": "12345",
"data": null,
"electron": {
"printDelay": "5000"
},
"scripts": []
}
Thanks for your time!