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

pdf-write-page

v1.2.0

Published

just write text in different color, font, and size to a existing pdf and save the result

Downloads

13

Readme

just write text in different color, font, and size to a existing pdf and save the result

API

Example:

pdf = require 'pdf-write-page'
pdf {in:'test_unmodified.pdf', out:'test_modified.pdf', pageNumber:0}
.write 10, 0, 'A'
.write 10, 14, 'B'
.cfg {size:60}
.write 10, 28, 'C'
.restoreCfg()
.write 100, 100, 'D'
.end()

end also saves to out path.

page offset is bottom, left (x = 0, y = 0)

.write()

writes some text

.write(x, y, text)

.image()

add an image (jpg, pdf, tiff) to the pdf

copied from https://github.com/galkahana/HummusJS/wiki/Show-images

Optionally there's a 4th parameter which is an options object. The object may have the following properties, to modify the default image placement behaviour:

  • index - for multi-page image formats (tiff, PDF), index determines the page to show. Default is the first image in the collection.
  • transformation - transformation method. Can be either a array or an object. If it is a array, then transformation will be a 6 numbers matrix, allowing you to scale, rotate, translate or whatnot. If it is an object, than it is meant for defining an image fitting behaviour. You will define bounding with/height, and the module will scale the image in accordance. the object may have the following attributes:
    • width - required, width of bounding box
    • height - required, height of bounding box
    • proportional - boolean, should the fit method maintain the image proportions?
    • fit - either always or overflow. If always Fit may always happen scaling up or down. If overflow fit will scale only if the image dimensions overflow the box.

example:

.image(x, y, path, opts)

.page()

set the current page that is modified Pagecount starts as 0

exmaple:

    .page(1) # update page 2

.cfg()

options:

    fontPath   : ''
    size       : 14
    colorspace : 'gray'
    color      : 0x00