@admin, thanks, good solution. works for me now.
Xushlin
@Xushlin
Posts made by Xushlin
-
RE: How to fix lost line breaks when using unoconv to convert DOCX to PDF?
-
How to fix lost line breaks when using unoconv to convert DOCX to PDF?
How to fix lost line breaks when using unoconv to convert DOCX to PDF?
I used Docx template preview with Docx works well. but convert to PDF it lost line breaks.1.Word template like this:
{{preserveLineBreaks Description}}
2.preserveLineBreaks function like this:function escapeXml(unsafe) { return unsafe.replace(/[<>&'"]/g, function (c) { switch (c) { case '<': return '<'; case '>': return '>'; case '&': return '&'; case '\'': return '''; case '"': return '"'; } }); } function preserveLineBreaks(d) { if(d){ return new Handlebars.SafeString(escapeXml(d).replace(/\n/g, '<w:br/>')); } }
3.Preview as word it works well and result as below:
- But it lost line break when I enabled unoconv and preview as PDF, and the reslut as below:
- How to fix this issues?
- But it lost line break when I enabled unoconv and preview as PDF, and the reslut as below:
-
How to call the sub folder's tempalte via API?
Re: Organizing templates in folders under data
How to via API invoke the tempate of the sub folder? how to translate the template paramaters?
example:
templates/
|---subFolders/
------ foo1
------ foo2
---foo1
---foo2How to call the templates/subFolers/foo1 in the API?
-
RE: How to render a content contain '&' in the docx?
My template have a custom break line fuction. template like this:
{{preserveLineBreaks foo}}the function as below:
function preserveLineBreaks(d) { return new Handlebars.SafeString(d.replace(/\n/g, '<w:br/>')) } please see the example here: https://playground.jsreport.net/w/Xushlin/6FhQQRdP
-
How to render a content contain '&' in the docx?
I render a docx template error when a field string contain a character '&' .
how to fix this problem?
blow is error picture:
-
How to use the pdf utils?
I want use the pdf utils pass value to Header or Footer. I added the tag <div> {{{pdfAddPageItem :ClientName}}}</div> to my main template, but I got an errors as below:
Error: Error while executing templating engine. Syntax error Unmatched or missing {{/pdfAddPageItem}}, in template: ... at C:\jsreportapp\node_modules\jsrender\jsrender-node.js:223:27 at Object.<anonymous> (C:\jsreportapp\node_modules\jsrender\jsrender-node.js:2879:2) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\jsreportapp\node_modules\jsreport-jsrender\lib\jsrenderEngine.js:6:16) From previous event: at executeScript (C:\jsreportapp\node_modules\jsreport-core\lib\util\executeScript.js:41:49) at Reporter.executeScript (C:\jsreportapp\node_modules\jsreport-core\lib\reporter.js:343:12) at invokeRender (C:\jsreportapp\node_modules\jsreport-core\lib\render\render.js:60:36) at module.exports (C:\jsreportapp\node_modules\jsreport-core\lib\render\render.js:150:11) at <anonymous>
below was my studio version information:
about version: 2.11.0 Release notes engines: handlebars, jsrender, none recipes: chrome-image, chrome-pdf, docx, html, html-to-xlsx, html-with-browser-client, pptx, static-pdf, text, xlsx assets: 1.7.0 authentication: 2.6.1 authorization: 2.4.0 base: 2.0.2 browser-client: 2.2.2 child-templates: 1.4.0 chrome-pdf: 1.10.0 cli: 2.2.5 data: 2.4.0 debug: 2.1.3 docx: 2.9.0 express: 2.8.1 freeze: 2.0.0 fs-store: 2.9.1 handlebars: 2.1.0 html-to-xlsx: 2.8.3 import-export: 2.1.1 jsrender: 2.1.1 licensing: 2.2.3 pdf-utils: 1.11.0 pptx: 0.7.0 public-templates: 2.2.0 reports: 2.5.1 resources: 2.1.0 sample-template: 2.6.1 scheduling: 2.5.0 scripts: 2.6.0 static-pdf: 0.4.0 studio: 2.10.1 studio-theme-dark: 0.3.0 tags: 2.5.0 templates: 2.4.0 text: 2.0.0 unoconv: 0.3.0 version-control: 1.6.0 xlsx: 2.5.0
How to fix the errors?
-
RE: Checkbox can't works on the nested dockList
@bjrmatos regarding the image, shall I upgrade the jsreport version?
-
RE: Checkbox can't works on the nested dockList
@bjrmatos , 1.- I using docxList should be correct, different type the Answer different, if type==1or type==2 it was a list, if type==0 if was a simple text.
I have using the #each instead of the #dockList, works well, My custom have buy the jsreport licence , could you please provide a full docx helper guidline for me? I look at the docx recipe api, but it have less description and helper(https://jsreport.net/learn/docx), we will convert all pdf report to docx. maybe we will display all forms in the docx. -
RE: Checkbox can't works on the nested dockList
Please look at my example here: https://playground.jsreport.net/w/Xushlin/FmFNHLl9