Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
The pdfmake npm package is a server-side and client-side library for generating PDF documents from a JSON-based structure. It provides a declarative API that allows developers to layout text, images, vectors, and other elements in a PDF document.
Text and Typography
This feature allows you to add text to your PDF with various typography settings such as font size, style, and weight.
{"content": [{"text": "Hello World", "style": "header"}], "styles": {"header": {"fontSize": 18, "bold": true}}}
Lists
With this feature, you can create ordered and unordered lists within your PDF document.
{"content": [{"ul": ["Item 1", "Item 2", "Item 3"]}]}
Tables
This feature allows you to insert tables into your PDF, with customizable rows, columns, and styling.
{"content": [{"table": {"body": [["Column 1", "Column 2", "Column 3"], ["Value 1", "Value 2", "Value 3"]]}}]}
Images
This feature enables you to embed images in your PDF documents, with support for various formats and base64 encoded sources.
{"content": [{"image": "data:image/jpeg;base64,...", "width": 200}]}
Vector Graphics
With vector graphics, you can draw shapes and paths to create custom illustrations and designs in your PDF.
{"content": [{"canvas": [{"type": "rect", "x": 0, "y": 0, "w": 100, "h": 100, "color": "#E53935"}]}]}
html-pdf is a Node.js package that converts HTML to PDF. It uses PhantomJS as a rendering engine. Unlike pdfmake, which uses a JSON structure, html-pdf allows you to define your PDF layout using HTML and CSS.
pdf-lib is a library for creating and modifying PDF documents in any JavaScript environment. It provides low-level PDF manipulation capabilities and differs from pdfmake by offering more control over the PDF creation process at the expense of a steeper learning curve.
PDF document generation library for server-side and client-side usage in pure JavaScript.
Check out the playground and examples.
Documentation URL: https://pdfmake.github.io/docs/
using npm:
git clone --branch 0.2 https://github.com/bpampuch/pdfmake.git
cd pdfmake
npm install
npm run build
using yarn:
git clone --branch 0.2 https://github.com/bpampuch/pdfmake.git
cd pdfmake
yarn
yarn run build
MIT
pdfmake is based on a truly amazing library pdfkit (credits to @devongovett).
Thanks to all contributors.
FAQs
Client/server side PDF printing in pure JavaScript
The npm package pdfmake receives a total of 684,020 weekly downloads. As such, pdfmake popularity was classified as popular.
We found that pdfmake demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.