Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
da-qr-watermark
Advanced tools
Readme
In this example we will follow a two-step process to first create (and store) an image of a QR code and then use that image to watermark a PDF document.
This example demonstrates several features of the Document Alchemy API:
How to create a QR code image.
How to create a document directly within the Document Alchemy file-store.
How to use a stored document within another API call.
How to watermark a PDF document (using a stored image and an uploaded PDF file).
How to delete a file from the Document Alchemy file-store.
(These instructions assume you've already installed a modern version of Node.js/IO.js. If you haven't yet, see https://nodejs.org/ for details.)
To simplify the task, this example uses the popular request module (on GitHub at request/request).
To install the module, simply run:
npm install
from within this directory (the one containing package.json
and this README
file). This will download and install all of the necessary third-party
libraries.
To run this example, you will need:
A DocumentAlchemy API key. If you don't have one yet, you can obtain one immediately by signing up for DocumentAlchemy.
A PDF document to watermark.
The general format for running this program is this:
node qr-watermark.js <API-KEY> <TEXT-TO-ENCODE> <PDF-TO-WATERMARK> [<OUTPUT-FILE-NAME>]
For example, if your API key value is HbblCNv7gLN2pasWFK44
, the command:
node qr-watermark.js HbblCNv7gLN2pasWFK44 "http://www.example.com/" myDocument.pdf watermarkedDocument.pdf
will create (or overwrite) the file watermarkedDocument.pdf
, containing a copy
of myDocument.pdf
with a QR code (pointing to www.example.com) stamped on
every page.
The output of the program may look something like this:
Creating the QR code...
...Success! Created and stored QR code as document ID "8cxwka1gbjoflxrqi2ux2z2".
Watermarking the PDF document using that stored image...
...Success! Watermarked PDF document saved at "watermarkedDocument.pdf".
Deleting the QR code...
...Success! Stored document deleted from the server.
(Note that qr-watermark.js
is also directly executable via:
qr-watermark.js <API-KEY> <TEXT-TO-ENCODE> <PDF-TO-WATERMARK> [<OUTPUT-FILE-NAME>]
if your shell recognizes the #!/usr/bin/env node
hash-bang identifier.)
Please review the code and comments found in qr-watermark.js
for a detailed
explanation of the process.
FAQs
An example of using the DocumentAlchemy API to generate a QR code and then stamp it on each page of a PDF as a watermark image.
The npm package da-qr-watermark receives a total of 2 weekly downloads. As such, da-qr-watermark popularity was classified as not popular.
We found that da-qr-watermark 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.