Socket
Socket
Sign inDemoInstall

svg-to-pdfkit

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-to-pdfkit - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

examples/options.htm

8

package.json
{
"name": "svg-to-pdfkit",
"version": "0.1.1",
"version": "0.1.2",
"description": "Insert SVG into a PDF document created with PDFKit",

@@ -20,9 +20,9 @@ "author": {

},
"readme": "# SVG-to-PDFKit\nInsert SVG into a PDF document created with PDFKit.\n\n#### Use:\n\n SVGtoPDF(doc, svg, x, y, options);\n \n&nbsp; &nbsp; If you prefer, you can add the function to the PDFDocument prototype:\n\n PDFDocument.prototype.addSVG = function(svg, x, y, options) {\n return SVGtoPDF(this, svg, x, y, options), this;\n };\n\n&nbsp; &nbsp; And then simply call:\n \n doc.addSVG(svg, x, y, options);\n\n#### Parameters:\n\n doc [PDFDocument] = the PDF document created with PDFKit\n svg [SVGElement or string] = the SVG object or XML code\n x, y [number] = the position where the SVG will be added\n options [Object] = >\n - width, height [number] = initial viewport, by default it's the page dimensions\n - preserveAspectRatio [string] = override alignment of the SVG content inside its viewport\n - useCSS [boolean] = use the CSS styles computed by the browser (for SVGElement only)\n - fontCallback [function] = function called to get the fonts, see source code\n - imageCallback [function] = same as above for the images (for Node.js)\n - assumePt [boolean] = assume that units are PDF points instead of SVG pixels\n\n#### Demo:\n&nbsp; &nbsp; <a href=\"https://alafr.github.io/SVG-to-PDFKit/examples/demo.htm\" target=\"_blank\">https://alafr.github.io/SVG-to-PDFKit/examples/demo.htm</a>\n\n#### Supported:\n - shapes: rect, circle, path, ellipse, line, polyline, polygon\n - special elements: use, nested svg\n - text elements: text, tspan, textPath\n - text attributes: x, y, dx, dy, rotate, text-anchor, textLength, word-spacing, letter-spacing, font-size\n - styling: with attributes only\n - colors: fill, stroke & color (rgb, rgba, hex, string), fill-opacity, stroke-opacity & opacity\n - units: all standard units\n - transformations: transform, viewBox & preserveAspectRatio attributes\n - clip paths & masks\n - gradients\n\n#### Unsupported:\n - links (<a href=\"https://github.com/alafr/SVG-to-PDFKit/issues/18\">#18</a>)\n - patterns\n - filters\n - other things I don't even know they exist\n\n#### Warning:\n - Make sure to use a fully updated PDFKit version: see <a href=\"https://github.com/alafr/pdfkit/wiki/How-to-install-and-build-a-PDFKit-branch\">here</a> how to build it\n - There are bugs, please send issues and/or pull requests.\n \n#### License:\n&nbsp; &nbsp; <a href=\"http://choosealicense.com/licenses/mit/\">MIT</a>\n\n#### Other useful projects:\n - <a href=\"https://github.com/devongovett/pdfkit\">PDFKit</a>, the JavaScript PDF generation library for Node and the browser.\n - For inserting SVG graphics into a PDFKit document there is also <a href=\"https://github.com/devongovett/svgkit\">svgkit</a>.\n - For the opposite conversion, from PDF to SVG, you can use <a href=\"https://github.com/mozilla/pdf.js\">Mozilla's PDF.js</a>.\n",
"readme": "# SVG-to-PDFKit\nInsert SVG into a PDF document created with PDFKit.\n\n#### Use:\n\n SVGtoPDF(doc, svg, x, y, options);\n \n&nbsp; &nbsp; If you prefer, you can add the function to the PDFDocument prototype:\n\n PDFDocument.prototype.addSVG = function(svg, x, y, options) {\n return SVGtoPDF(this, svg, x, y, options), this;\n };\n\n&nbsp; &nbsp; And then simply call:\n \n doc.addSVG(svg, x, y, options);\n\n#### Parameters:\n\n doc [PDFDocument] = the PDF document created with PDFKit\n svg [SVGElement or string] = the SVG object or XML code\n x, y [number] = the position where the SVG will be added\n options [Object] = >\n - width, height [number] = initial viewport, by default it's the page dimensions\n - preserveAspectRatio [string] = override alignment of the SVG content inside its viewport\n - useCSS [boolean] = use the CSS styles computed by the browser (for SVGElement only)\n - fontCallback [function] = function called to get the fonts, see source code\n - imageCallback [function] = same as above for the images (for Node.js)\n - assumePt [boolean] = assume that units are PDF points instead of SVG pixels\n\n#### Demos:\n&nbsp; &nbsp; <a href=\"https://alafr.github.io/SVG-to-PDFKit/examples/demo.htm\" target=\"_blank\">https://alafr.github.io/SVG-to-PDFKit/examples/demo.htm</a>\n\n&nbsp; &nbsp; <a href=\"https://alafr.github.io/SVG-to-PDFKit/examples/options.htm\" target=\"_blank\">https://alafr.github.io/SVG-to-PDFKit/examples/options.htm</a>\n\n#### Supported:\n - shapes: rect, circle, path, ellipse, line, polyline, polygon\n - special elements: use, nested svg\n - text elements: text, tspan, textPath\n - text attributes: x, y, dx, dy, rotate, text-anchor, textLength, word-spacing, letter-spacing, font-size\n - styling: with attributes only\n - colors: fill, stroke & color (rgb, rgba, hex, string), fill-opacity, stroke-opacity & opacity\n - units: all standard units\n - transformations: transform, viewBox & preserveAspectRatio attributes\n - clip paths & masks\n - images\n - fonts\n - gradients\n - patterns\n\n#### Unsupported:\n - links (<a href=\"https://github.com/alafr/SVG-to-PDFKit/issues/18\">#18</a>)\n - filters\n - text attributes: text-decoration, font-variant, writing-mode, unicode-bidi\n - foreignObject (<a href=\"https://github.com/alafr/SVG-to-PDFKit/issues/37\">#37</a>)\n - other things I don't even know they exist\n\n#### Warning:\n - Use an updated PDFKit version (≥0.8.1): see <a href=\"https://github.com/alafr/pdfkit/wiki/How-to-install-and-build-a-PDFKit-branch\">here</a> how to build it, or use the prebuilt file in the <a href=\"https://github.com/alafr/SVG-to-PDFKit/tree/master/examples\">examples</a> folder.\n - There are bugs, please send issues and/or pull requests.\n \n#### License:\n&nbsp; &nbsp; <a href=\"http://choosealicense.com/licenses/mit/\">MIT</a>\n\n#### Other useful projects:\n - <a href=\"https://github.com/devongovett/pdfkit\">PDFKit</a>, the JavaScript PDF generation library for Node and the browser.\n - For inserting SVG graphics into a PDFKit document there is also <a href=\"https://github.com/devongovett/svgkit\">svgkit</a>.\n - For the opposite conversion, from PDF to SVG, you can use <a href=\"https://github.com/mozilla/pdf.js\">Mozilla's PDF.js</a>.\n",
"readmeFilename": "README.md",
"homepage": "https://github.com/alafr/SVG-to-PDFKit#readme",
"_id": "svg-to-pdfkit@0.1.1",
"_shasum": "7a3b1fd7a613c2c01c0f22e32094040811ca377c",
"_id": "svg-to-pdfkit@0.1.2",
"_shasum": "5409ed37dcb94749caa7639e26eedd73e8e0d6e4",
"_resolved": "https://github.com/alafr/SVG-to-PDFKit/tarball/master",
"_from": "https://github.com/alafr/SVG-to-PDFKit/tarball/master"
}

@@ -31,5 +31,7 @@ # SVG-to-PDFKit

#### Demo:
#### Demos:
&nbsp; &nbsp; <a href="https://alafr.github.io/SVG-to-PDFKit/examples/demo.htm" target="_blank">https://alafr.github.io/SVG-to-PDFKit/examples/demo.htm</a>
&nbsp; &nbsp; <a href="https://alafr.github.io/SVG-to-PDFKit/examples/options.htm" target="_blank">https://alafr.github.io/SVG-to-PDFKit/examples/options.htm</a>
#### Supported:

@@ -45,12 +47,16 @@ - shapes: rect, circle, path, ellipse, line, polyline, polygon

- clip paths & masks
- images
- fonts
- gradients
- patterns
#### Unsupported:
- links (<a href="https://github.com/alafr/SVG-to-PDFKit/issues/18">#18</a>)
- patterns
- filters
- text attributes: text-decoration, font-variant, writing-mode, unicode-bidi
- foreignObject (<a href="https://github.com/alafr/SVG-to-PDFKit/issues/37">#37</a>)
- other things I don't even know they exist
#### Warning:
- Make sure to use a fully updated PDFKit version: see <a href="https://github.com/alafr/pdfkit/wiki/How-to-install-and-build-a-PDFKit-branch">here</a> how to build it
- Use an updated PDFKit version (≥0.8.1): see <a href="https://github.com/alafr/pdfkit/wiki/How-to-install-and-build-a-PDFKit-branch">here</a> how to build it, or use the prebuilt file in the <a href="https://github.com/alafr/SVG-to-PDFKit/tree/master/examples">examples</a> folder.
- There are bugs, please send issues and/or pull requests.

@@ -57,0 +63,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc