npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

insgen

v1.0.12

Published

PDF Annotation Tools

Downloads

3

Readme

PDF Annotation Tools

This repository contains two scripts that allow you to work with PDF annotations: one for extracting annotations from a PDF file and saving them to a text file, and another for embedding text annotations into a PDF file using coordinates and annotations text from a provided text file.

Prerequisites

Before using these scripts, ensure you have the following prerequisites:

Node.js installed on your machine Installation

To install the required dependencies, follow these steps:

Clone or download this repository to your local machine. Open a terminal and navigate to the downloaded repository's directory. Install the required dependencies using npm: plaintext Copy code npm install This will install the necessary packages, including pdfjs-dist, yargs, and pdf-lib. Script 1: PDF Annotation Extractor

Usage To extract annotations from a PDF file and save them to a text file, follow these steps:

Make sure you have completed the installation steps mentioned above. Run the script using Node.js with the following command: plaintext

node extract_pdf_annotations.js <path_to_pdf> <output_txt_file>

Replace <path_to_pdf> with the path to the PDF file you want to extract annotations from, and <output_txt_file> with the desired path for the output text file. For example: plaintext Copy code

node extract_pdf_annotations.js input.pdf output_annotations.txt

The annotations will be extracted and saved to the specified output text file. You will see a confirmation message once the process is complete. Script 2: PDF Annotations Embedder

Usage To embed text annotations into a PDF file using coordinates and annotations text from a provided text file, follow these steps:

Make sure you have completed the installation steps mentioned above. Run the script using Node.js with the following command: plaintext Copy code


node embed_annotations.js <pdf_path> <annotations_txt_path> <output_pdf_path>

Replace <pdf_path> with the path to the PDF file you want to embed annotations into, <annotations_txt_path> with the path to the annotations text file, and <output_pdf_path> with the desired path for the output PDF file. For example: plaintext Copy code

node embed_annotations.js input.pdf annotations.txt output_annotated.pdf

The script will process each line in the annotations text file, where each line specifies the page number, x-coordinate, y-coordinate, and annotation text. Annotations will be embedded into the specified PDF file at the specified coordinates on the respective pages. The modified PDF with embedded annotations will be saved as the output PDF file. You will see a confirmation message once the process is complete. Notes

Both scripts are provided as-is under the ISC License. Feel free to use, modify, and distribute them as needed.