No, I didn't solve this. I abandoned the idea of merging existing pdf files. When I need to include external PDF files in my reports I use links instead.
msageryd
@msageryd
Posts made by msageryd
-
RE: Merging static-pdf, orientation issues
-
RE: Word found unreadable content in ...
About docx rendering..
I'm a bit confused betweendocx
anddocxtemplater
When I started out testing this I installed this package in my jsreport Docker image:
@jsreport/jsreport-docxtemplater
The naming and the location of the docxtemplater repo has changed over time. Is docxtemplater a different extension than docx?
What's the difference?
Which should I use?
Do I need to install the docxtemplater module in order to use docx? -
RE: Word found unreadable content in ...
3.13.0 worked better.
I suppose something is fixed since 3.11.Sorry for not supplying my verison.
-
RE: Word found unreadable content in ...
I forked your playground test and:
- uploaded my testdata
- uploaded my docx template again
The rendered Word file opens up fine in Word at my Mac.
The only difference is probably the jsreport version. I completely forgot to disclose my version: 3.11.3.
I see that Playground is at 3.13. I'll try to upgrade my version and post back here. -
RE: Word found unreadable content in ...
Here is some more insight.
If I misspell the property for the array, the doc will be empty (reasonable). In this case the warning does not come up.My sample dataset only has four items. This is how the document looks when I'm opening it and answer yes to the warning question.
-
RE: Word found unreadable content in ...
I tried to isolate the problem by removing stuff from the template. As soon as I add {{docxTable}} I get into trouble.
The only thing in the template file is a table with three columns and the following tags:
I wasn't able to upload the document here. I get "you don't have enough privileges for this action".
I have emailed the template to Jan (didn't have your email). -
Word found unreadable content in ...
When I generate Word files with the docx extension I get this when I'm opening the file. I'm using Word on MacOS. Is this a Mac related problem?
Here is the exact message text from Word:
Word found unreadable content in Word.test.docx. Do you want to recover the contents of this document? If you trust the source of this document, click Yes.
-
RE: Chrome-pdf has stopped showing highcharts
Thanks for this.
I noticed the same on a report we haven't had time to migrate to jsReport 3.
Your solution worked, but I moved the report to our v3 server instead. This works with HighCharts 11. -
RE: Best way to insert data into rendered report for "append"
I ended up by simply appending my new data to req.data, like this:
const blueprint = await jsreport.render({ template: { shortid: 'rJxZpXJYwB', recipe: 'chrome-pdf' }, data: { ...res.data, test: 'TEST ABC' } });
What confuses me is that I don´t need to append any data if no new data is needed.
Is the following true?
- If no data is supplied to jsreport.render, jsreport will autmatically use res.data.
-
Best way to insert data into rendered report for "append"
I need to append a report with differend page size (A3), so I need to use
append
. First I'm rendering the repor and then I'm appending it with pdfUtils.I know that I can add
data
to the render command, but this doesn't seem to be necessary. The original req.data seems to be available in the rendered report anyway.I need to add some specific information to the appended report. How would I insert this information via the render command and how would I reach it from within the rendered report?
Here is how I do it right now, without inserting any new data:
const jsreport = require('jsreport-proxy') async function afterRender(req, res) { const blueprint = await jsreport.render({ template: { shortid: 'rJxZpXJYwB', recipe: 'chrome-pdf' }, }) res.content = await jsreport.pdfUtils.append(res.content, blueprint.content) }