Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
The print-js npm package is a lightweight JavaScript library that allows you to easily print content from your web pages. It supports printing HTML elements, PDFs, and images, making it a versatile tool for web developers who need to implement printing functionality in their applications.
Print HTML Elements
This feature allows you to print specific HTML elements by providing the element's ID. The 'type' parameter is set to 'html' to indicate that the content to be printed is HTML.
printJS({ printable: 'elementId', type: 'html' });
Print PDF Files
This feature allows you to print PDF files by providing the path to the PDF file. The 'type' parameter is set to 'pdf' to indicate that the content to be printed is a PDF file.
printJS({ printable: 'path/to/pdf/file.pdf', type: 'pdf' });
Print Images
This feature allows you to print images by providing the path to the image file. The 'type' parameter is set to 'image' to indicate that the content to be printed is an image.
printJS({ printable: 'path/to/image.jpg', type: 'image' });
The 'print-this' package is a jQuery plugin that provides similar functionality to print-js. It allows you to print specific parts of a web page, including HTML elements and their styles. Unlike print-js, which is a standalone JavaScript library, print-this requires jQuery as a dependency.
The 'react-to-print' package is a React component that provides printing functionality for React applications. It allows you to print React components and their styles. This package is specifically designed for use with React, whereas print-js can be used with any JavaScript application.
The 'printd' package is a lightweight library for printing HTML content. It creates an iframe to load the content to be printed, ensuring that the printed content is isolated from the rest of the page. This approach is similar to print-js, but printd focuses on providing a minimal and straightforward API for printing HTML content.
A tiny javascript library to help printing from the web.
For documentation and examples please visit: printjs.crabbly.com
You can download the latest version of Print.js on GitHub or just use the Print.js CDN links available on the documentation page.
To install via npm:
npm install print-js --save
You can find documentation at printjs.crabbly.com.
Contributions to Print.js are welcome and encouraged.
The issue tracker is the preferred channel for reporting bugs, requesting new features and submitting pull requests.
Keep in mind that we would like to keep this a lightweight library.
Please do not use the issues channel for support requests. For help using Print.js, please ask questions on Stack Overflow and use the tag printjs
.
Well structured, detailed bug reports are hugely valuable for the project.
Please provide any additional details associated with the bug.
Clear, concise pull requests are excellent at continuing the project's community driven growth.
Print.js is available under the MIT license.
FAQs
A tiny javascript library to help printing from the web.
We found that print-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.