Awesome, thanks.
Posts made by ThePolymorph
-
RE: PDFUtils causing file size to increase exponentially
Hi @jan_blaha can you advise if the above fix (npm i jsreport/jsreport-pdf-utils) has been added yet, it's been working for me for the last 4 months without issue from the docker image I created (as advised above).
-
RE: Formatting issue with pdfCreatePagesGroup
Hi @jan_blaha with regards to your comment "In main template do {{:~pdfCreatePagesGroup(HeaderFooter.Id)}} In the merged operation search the root data Data array for HeaderFooter with the passed Id." How do you search for the id the merged operation? is there an example somewhere I can reference?
-
RE: Application error when applying application settings in Azure
@jan_blaha thanks for that I added the setting and restarted the app but it doesn't to be working. How do I access the output logs and does the following setting need to be changed:
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false",
"slotSetting": false
} -
RE: Application error when applying application settings in Azure
Update: No errors now but on every restart the persistance is not working and sample file creation is being requested.
[
{
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "",
"slotSetting": false
},
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "https://index.docker.io",
"slotSetting": false
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
"value": "",
"slotSetting": false
},
{
"name": "extensions_authentication_admin_password",
"value": "",
"slotSetting": true
},
{
"name": "extensions_authentication_admin_username",
"value": "",
"slotSetting": true
},
{
"name": "extensions_authentication_cookieSession_secret",
"value": "",
"slotSetting": true
},
{
"name": "extensions_chromePdf_timeout",
"value": "1000000",
"slotSetting": true
},
{
"name": "extensions_fsStoreAzureSbSync_connectionString",
"value": "",
"slotSetting": true
},
{
"name": "extensions_fsStoreAzureStoragePersistence_accountKey",
"value": "",
"slotSetting": true
},
{
"name": "extensions_fsStoreAzureStoragePersistence_accountName",
"value": "",
"slotSetting": true
},
{
"name": "extensions_fsStoreAzureStoragePersistence_provider",
"value": "azure-storage",
"slotSetting": true
},
{
"name": "licenseKey",
"value": "",
"slotSetting": true
},
{
"name": "phantom_numberOfWorkers",
"value": "8",
"slotSetting": true
},
{
"name": "templatingEngines_numberOfWorkers",
"value": "8",
"slotSetting": true
},
{
"name": "templatingEngines_strategy",
"value": "http-server",
"slotSetting": true
}
] -
Application error when applying application settings in Azure
Hi,
We have a custom version of jsreport 2.6.0-full with the latest pdf-utils running in a docker container but are getting an applicaiton error (web page just says applicaiton error) when applying extension settings in Azure which is our preference e.g. extensions_authentication_admin_password or extensions_fsStoreAzureSbSync_connectionString . We have tried placing the settings in a config file and the username and password are working but not the Azure storage. See config file below:
{
"allowLocalFilesAccess": true,
"licenseKey":"keyhere",
"extensions":
{
"authentication" : {
"cookieSession": {
"secret": "secret_here"
},
"admin": {
"username": "usernamehere",
"password": "passwordhere"
}
},
"fsStoreAzureStoragePersistence":{
"accountName":"accountNamehere",
"accountKey":"keyhere"
},
"fsStore":{
"persistance":{"provider":"azure-storage"}
},
"fsStoreAzureSbSync":{
"connectionString":"connectionstringhere"
}
}
} -
RE: PDFUtils causing file size to increase exponentially
@jan_blaha ok thanks, I'll give that a go. For something so critical (in my opinion) will this be included in future versions?
-
RE: PDFUtils causing file size to increase exponentially
@jan_blaha wow! that brought a 1.2mb report back down to 200kb locally. This gives me a lot of hope so now going back to the question above how do I get this to work through the docker container, we are running this through Azure?
-
RE: PDFUtils causing file size to increase exponentially
Hi @jan_blaha I'm using the latest version but will certainly try that. Has this also been updated in the docker container as this is the area where it is most needed.
Thanks again
-
PDFUtils causing file size to increase exponentially
Hi,
We have been using jsreport for about a year and a half and love it. With assistance from @jan_blaha and @bjrmatos we successfully transitioned our reports from a fixed template to a dynamic one using a header and footer with auto populating page numbers and dynamic header and footer content.
Locally I noticed the performance was slower but didn't fully realise why until we published our changes in preparation for a big demo. We were using a $AU 20 a month Azure plan with our fixed template and getting really good performance i.e. 3-4 seconds for an 8 page report with images (around 200kb) we were extremely happy. Using PDFUtils to generate a dynamic header and footer (a hot topic for our reports) has blown the file size to 1.2mb. This doesn't seem like much but when you're talking 1000s of reports which need to be downloaded in bulk we're looking at a significant hosting cost increase (well over $400 a month which we had to use for our demo).
To negate issues with our design I created a blank template which downloads to a 9kb pdf. I then created a blank header-footer template and selected Merge Whole document . With a single page the file size jumped to 22kb I then added some page breaks in the main document and saw it jump to 44kb. This appears to confirm our suspicion that the pdfutil operation is taking the content of our main report from 189kb (8 pages) to 1.1mb when adding a header footer using PDFUtils. See this example of what happens to a 16kb file when pdfutils merge whole document is applied. https://playground.jsreport.net/w/ThePolymorph/Ttv3wrkl
My fear us that unless there is a straight forward way to have a dynamic header and footer and keep the file size low we will need to look for an alternative platform which would be a real shame.
Assistance in getting a workable solution would be greatly appreciated as we really love this platform.
Thanks again.
-
RE: Formatting issue with pdfCreatePagesGroup
@jan_blaha would you be able to provide an example of how to search the root data in the merged operation using jsrender? Thanks again.
-
RE: Formatting issue with pdfCreatePagesGroup
Looks like the answer is to use helpers instead. That gets me moving forward at least. I'm now wrapping sections in <div style={display:{{:~helpername(mysettings)}} to return "block" or "none" which works pretty well.
-
RE: Formatting issue with pdfCreatePagesGroup
@jan_blaha Thanks for that I get the concept but I'm not sure how to do the second part i.e. searching for the id in the merged operation. For the sake of time we ended up implementing a URL shorterning service but I think your solution would make life easier going forward. We're now finding that using {{if}} fails if we reference any of the values e.g. {{>~root.$pdf.pages[#index].group.Student.Student.FullName}} will return the value we need but wrap it in an if statement and we get Cannot read property 'group' of undefined at Object.callbackRequests. Is this a known issue with a workaround (I have checked the forum for other {{if}} issues but cannot find this one specifically.)
-
RE: Formatting issue with pdfCreatePagesGroup
Hi @jan_blaha
Can you please give me some more direction on that solution please.
Here are the details of how we are using the URL.
The URL is assembled in .Net and passed through in JSON format as follows:
{ "Data": [ { "HeaderFooter": { "Student": { "Id": 9, "ImageUrl": "https://website/folder-path/filename.jpg?securitytokendetail" }, "School": { "EmblemUrl" : "https://website/folder-path/filename.jpg?securitytokendetail" } }, "LotsofOtherSections": {}
in .Net jsreport is called like this:
var PDFreport = await rs.RenderByNameAsync("reportname", reportJson, cancellationToken); return File(PDFreport.Content, "application/octet-stream"); }
In jsreport in the main template we use this:
{{:~pdfCreatePagesGroup(HeaderFooter)}}
In the header footer the URL is referenced like this, note this is one example, the student image can also be displayed.
<img src={{:School.EmblemUrl}} onerror="this.onerror=null;this.src='{#asset blankschoollogo.png @encoding=dataURI}';" class="logo" />
Thanks again.
-
RE: Formatting issue with pdfCreatePagesGroup
Thanks @jan_blaha The value being passed is a link to an image in azure storage which varies per report so I'm not sure how that will help. Is there any way to override the <span> width?
-
Formatting issue with pdfCreatePagesGroup
Hi,
I've come across an issue where if the data being passed to a header footer form contains a long text string it is impacting the page width. In my case the data contains an encrypted URL which is hundreds of characters long.
If I look at the HTML generated by pdfCreatePagesGroup with a short string I get:
<span style='position:absolute;text-transform: none;opacity: 0.01;fontsize:1.1px'>group@@@InBvdGF0byI=@@@</span>
and this if the data contains a really long URL
<span style='position:absolute;text-transform: none;opacity: 0.01;fontsize:1.1px'>group@@@eyJTZXR0aW5ncyI6eyJnZW5iZ3RoZW1lY29sb3IiOiIjNDE2YzkwIn0sIlNjaG9vbCI6eyJJZCI6MSwiVW5pcXVlSWQiOiI0Y2E2OTMzYy1hOGY5LT (gets cut off on the page due to its length but spans the entire page and throws the width)
Is this a known issue and is there an easy work around?
Thanks again.
(I'm using chrome-pdf and jsrender) -
Resetting the page count
Hi,
I'm using chrome-pdf and jsrender with pdfutils for the header-footer to show student reports.
Each student report can be a varying number of pages (by design) and all reports are rendered sequentially and output in the same output file (as a requirement).
Student A has 8 pages and Student B's report currently commences on page 9. Is there a way to reset the page count so that Student B and subsequent reports always start at page 1 noting that each report can have a different number of pages.
The json is pretty detailed but follows this format:
{
"Data": [
{
"StudentA": {etc.}
},
{
"StudentB": {etc..}
}
]
}I'm currently using the following code to show the page number:
function getPageNumber (pageIndex) {
if (pageIndex == null) {
return ''
}const pageNumber = pageIndex + 1 return pageNumber
}
Thanks
-
RE: pdfCreatePagesGroup and pdfAddPageItem using jsrenderengine
@bjrmatos for pdfutils I'm not sure if you've updated the examples on the actual page to jsrender too, there's one that explains how to pass an object like this {{{pdfCreatePagesGroup name="Jan" age=33}}}, I tried {{:~pdfCreatePagesGroup(name="jan",age=33)}} but no joy, am I missing something obvious?
-
RE: pdfCreatePagesGroup and pdfAddPageItem using jsrenderengine
@bjrmatos awesome, thank you very much!!