Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
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 in pure JavaScript.
Check out the playground and examples.
Documentation URL: https://pdfmake.github.io/docs/
Source of documentation: https://github.com/pdfmake/docs Improvements are welcome!
using npm:
git clone https://github.com/bpampuch/pdfmake.git
cd pdfmake
npm install
npm run build
using yarn:
git clone 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.
0.3.0-beta.15 - 2025-01-01
pdfkit
package, moving away from @foliojs-fork
FAQs
Client/server side PDF printing in pure JavaScript
The npm package pdfmake receives a total of 434,119 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 4 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.