cross-platform-pdf-generator
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "cross-platform-pdf-generator", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "pulsation pdg generator for web and ios", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -432,11 +432,11 @@ import { PDFDocument, StandardFonts, rgb, PDFFont, PDFPage, PDFTextField } from 'pdf-lib'; | ||
const font = await document.embedFont(StandardFonts.Helvetica); | ||
const img = json?.documentSettings?.footerPNG; | ||
const img = json?.documentSettings?.footerJPGx; | ||
//create PDF Img | ||
let pngImage; | ||
let jpegImage; | ||
try { | ||
const baseIMG = await document.embedPng(img); | ||
pngImage = baseIMG; | ||
const baseIMG = await document.embedJpg(img); | ||
jpegImage = baseIMG; | ||
}catch { | ||
pngImage = null; | ||
jpegImage = null; | ||
} | ||
@@ -446,3 +446,3 @@ | ||
pages.forEach(page => { | ||
printFooterOnPage(page, document, pngImage, i, font, | ||
printFooterOnPage(page, document, jpegImage, i, font, | ||
json?.documentSettings?.footerText, | ||
@@ -449,0 +449,0 @@ json?.documentSettings?.footerVersion, |
@@ -18,3 +18,3 @@ import { GenericStorage } from "./utils/GenericUtils/GenericStorage.js"; | ||
"footer": false, | ||
"footerPNG": "", //set footer img as base64 encoded String | ||
"footerJPG": "", //set footer img as base64 encoded String | ||
"footerText": "", | ||
@@ -190,3 +190,3 @@ "footerVersion": "0.0.0", // is environment == node this is not used (package version will print on footer) | ||
if (value === undefined) return; | ||
const valueToPrint = value?.value ?? "Ungültiger Wert im Druck" | ||
const valueToPrint = value?.humanReadableDescription ?? "Ungültiger Wert im Druck" | ||
/* | ||
@@ -193,0 +193,0 @@ const rawValue = getValueFromStorage(value); //ToDo load human readable string instead of value |
@@ -29,2 +29,3 @@ | ||
* @param {String} view_name | ||
* @param {String} humanReadableDescription | ||
*/ | ||
@@ -36,3 +37,3 @@ constructor(creation_date, creator, geo_lat, | ||
server_function, server_query, storagePath, syncTag, | ||
value, value_type, view_id, view_name) { | ||
value, value_type, view_id, view_name, humanReadableDescription) { | ||
@@ -64,2 +65,3 @@ if (row_id == null) { throw { name: "GenericStorage ERROR", message: "GenericStorage needs to have valid row uuids" }; } | ||
this.view_name = view_name; | ||
this.humanReadableDescription = humanReadableDescription; | ||
} | ||
@@ -66,0 +68,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65958
1539