@ind-rcg/plugins-printengine 254.1005.0 → 260.1004.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/printEngine.js +110 -110
- package/dist/dev/src/contractToIntermediateJSONClass.js +4 -0
- package/dist/dev/src/index.js +7 -0
- package/dist/dev/src/macroHandlerClass.js +1 -0
- package/dist/dev/src/pdfConverterClass.js +1 -1
- package/dist/prod/printEngine.js +1 -1
- package/dist/prod/printEngine.js.LICENSE.txt +4 -2
- package/package.json +13 -12
|
@@ -850,6 +850,10 @@ class ContractToIntermediateJSON {
|
|
|
850
850
|
}
|
|
851
851
|
|
|
852
852
|
__makeTextOnlyNode(currentJsonElement) {
|
|
853
|
+
// Initialize elements array if undefined (handles empty <p></p> or <p> </p> tags)
|
|
854
|
+
if (_.isNil(currentJsonElement.elements)) {
|
|
855
|
+
currentJsonElement.elements = [];
|
|
856
|
+
}
|
|
853
857
|
_.remove(currentJsonElement.elements, (ele)=> { return ele.type !== ELEMENT_TYPE.TEXT;});
|
|
854
858
|
if(currentJsonElement.elements.length === 0) {
|
|
855
859
|
currentJsonElement.elements.push({type:ELEMENT_TYPE.TEXT, text: ""});
|
package/dist/dev/src/index.js
CHANGED
|
@@ -55,6 +55,13 @@ function __validateCommonParameters(contract, params, format){
|
|
|
55
55
|
function __innerPrintLogic(printType, contract, params, _stream, format, config) {
|
|
56
56
|
let json = contractParser.toJson(contract, params);
|
|
57
57
|
let pdfDefinition = pdfConverter.toPdfDefinition(json, format, testReportName);
|
|
58
|
+
|
|
59
|
+
// For 3-inch PDFs, height will be 'auto' - set height to A4 height(842 pts) to split into multiple pages
|
|
60
|
+
// Note: Only modifying the pdfDefinition, which is used for preview on mobile and org, not the original json (used for printing)
|
|
61
|
+
if (pdfDefinition.pageSize && pdfDefinition.pageSize.height && pdfDefinition.pageSize.height === 'auto') {
|
|
62
|
+
pdfDefinition.pageSize.height = 842;
|
|
63
|
+
}
|
|
64
|
+
|
|
58
65
|
switch (printType) {
|
|
59
66
|
case PRINT_TYPE.STREAM:
|
|
60
67
|
pdfConverter.writeToStream(pdfDefinition, _stream);
|
|
@@ -111,6 +111,7 @@ class MacroHandler {
|
|
|
111
111
|
for (let i = 0; i < macroList.length; i++) {
|
|
112
112
|
this.__parseKeyValuePair(macroList[i], result);
|
|
113
113
|
}
|
|
114
|
+
// eslint-disable-next-line no-unused-vars
|
|
114
115
|
} catch (err){
|
|
115
116
|
// some invalid value encountered during parse
|
|
116
117
|
result = {};
|
|
@@ -1207,7 +1207,7 @@ class PdfConverter {
|
|
|
1207
1207
|
} else {
|
|
1208
1208
|
let pdfDocGenerator = null;
|
|
1209
1209
|
if (pdfDefinition.defaultStyle.font !== "PrintFont") {
|
|
1210
|
-
pdfDocGenerator = this.__pdfMake.createPdf(pdfDefinition, TableLayouts, BrowserFonts, BrowserFontsVfs.
|
|
1210
|
+
pdfDocGenerator = this.__pdfMake.createPdf(pdfDefinition, TableLayouts, BrowserFonts, BrowserFontsVfs.vfs);
|
|
1211
1211
|
}
|
|
1212
1212
|
else {
|
|
1213
1213
|
pdfDocGenerator = this.__pdfMake.createPdf(pdfDefinition, TableLayouts, BrowserFonts, pdfDefinition.printFont);
|