abstract-document
Advanced tools
Comparing version 4.3.9 to 4.3.10
@@ -5,2 +5,3 @@ "use strict"; | ||
var base64 = require("base64-js"); | ||
var svgToPdfKit = require("svg-to-pdfkit"); | ||
function renderImage( | ||
@@ -48,2 +49,12 @@ // tslint:disable-next-line:no-any | ||
} | ||
else if (format === "svg") { | ||
var svg = new TextDecoder().decode(component.data); | ||
var imageWidth_1 = component.bottomRight.x - component.topLeft.x; | ||
var imageHeight_1 = component.bottomRight.y - component.topLeft.y; | ||
svgToPdfKit(pdf, svg, component.topLeft.x, component.topLeft.y, { | ||
width: imageWidth_1, | ||
height: imageHeight_1, | ||
preserveAspectRatio: "xMinYMin" | ||
}); | ||
} | ||
break; | ||
@@ -50,0 +61,0 @@ case "subimage": |
import * as AD from "../../abstract-document"; | ||
import * as base64 from "base64-js"; | ||
import * as svgToPdfKit from "svg-to-pdfkit"; | ||
export function renderImage( | ||
@@ -44,2 +45,12 @@ // tslint:disable-next-line:no-any | ||
} | ||
else if (format === "svg") { | ||
var svg = new TextDecoder().decode(component.data); | ||
var imageWidth_1 = component.bottomRight.x - component.topLeft.x; | ||
var imageHeight_1 = component.bottomRight.y - component.topLeft.y; | ||
svgToPdfKit(pdf, svg, component.topLeft.x, component.topLeft.y, { | ||
width: imageWidth_1, | ||
height: imageHeight_1, | ||
preserveAspectRatio: "xMinYMin" | ||
}); | ||
} | ||
break; | ||
@@ -46,0 +57,0 @@ case "subimage": |
{ | ||
"name": "abstract-document", | ||
"version": "4.3.9", | ||
"version": "4.3.10", | ||
"description": "Dynamically create documents using code or JSX and render to any format", | ||
@@ -27,2 +27,3 @@ "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-document", | ||
"remark-sub-super": "^1.0.19", | ||
"svg-to-pdfkit": "^0.1.8", | ||
"ts-exhaustive-check": "^1.0.0", | ||
@@ -29,0 +30,0 @@ "unified": "^6.1.6" |
import * as AbstractImage from "abstract-image"; | ||
import * as AD from "../../abstract-document"; | ||
import * as base64 from "base64-js"; | ||
import * as svgToPdfKit from "svg-to-pdfkit"; | ||
@@ -50,2 +51,11 @@ export function renderImage( | ||
}); | ||
} else if (format === "svg") { | ||
const svg = new TextDecoder().decode(component.data); | ||
const imageWidth = component.bottomRight.x - component.topLeft.x; | ||
const imageHeight = component.bottomRight.y - component.topLeft.y; | ||
svgToPdfKit(pdf, svg, component.topLeft.x, component.topLeft.y, { | ||
width: imageWidth, | ||
height: imageHeight, | ||
preserveAspectRatio: "xMinYMin" | ||
}); | ||
} | ||
@@ -52,0 +62,0 @@ break; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
800721
13982
10
+ Addedsvg-to-pdfkit@^0.1.8
+ Addedsvg-to-pdfkit@0.1.8(transitive)