A JavaScript PDF generation library for Node and the browser

Related tags

Mad science pdfkit
Overview

PDFKit

A JavaScript PDF generation library for Node and the browser.

Description

PDFKit is a PDF document generation library for Node and the browser that makes creating complex, multi-page, printable documents easy. The API embraces chainability, and includes both low level functions as well as abstractions for higher level functionality. The PDFKit API is designed to be simple, so generating complex documents is often as simple as a few function calls.

Check out some of the documentation and examples to see for yourself! You can also read the guide as a self-generated PDF with example output displayed inline. If you'd like to see how it was generated, check out the README in the docs folder.

You can also try out an interactive in-browser demo of PDFKit here.

Installation

Installation uses the npm package manager. Just type the following command after installing npm.

npm install pdfkit

Features

  • Vector graphics
    • HTML5 canvas-like API
    • Path operations
    • SVG path parser for easy path creation
    • Transformations
    • Linear and radial gradients
  • Text
    • Line wrapping
    • Text alignments
    • Bulleted lists
  • Font embedding
    • Supports TrueType (.ttf), OpenType (.otf), WOFF, WOFF2, TrueType Collections (.ttc), and Datafork TrueType (.dfont) fonts
    • Font subsetting
    • See fontkit for more details on advanced glyph layout support.
  • Image embedding
    • Supports JPEG and PNG files (including indexed PNGs, and PNGs with transparency)
  • Annotations
    • Links
    • Notes
    • Highlights
    • Underlines
    • etc.
  • AcroForms
  • Outlines
  • PDF security
    • Encryption
    • Access privileges (printing, copying, modifying, annotating, form filling, content accessibility, document assembly)
  • Accessibility support (marked content, logical structure, Tagged PDF, PDF/UA)

Coming soon!

  • Patterns fills
  • Higher level APIs for creating tables and laying out content
  • More performance optimizations
  • Even more awesomeness, perhaps written by you! Please fork this repository and send me pull requests.

Example

const PDFDocument = require('pdfkit');
const fs = require('fs');

// Create a document
const doc = new PDFDocument();

// Pipe its output somewhere, like to a file or HTTP response
// See below for browser usage
doc.pipe(fs.createWriteStream('output.pdf'));

// Embed a font, set the font size, and render some text
doc
  .font('fonts/PalatinoBold.ttf')
  .fontSize(25)
  .text('Some text with an embedded font!', 100, 100);

// Add an image, constrain it to a given size, and center it vertically and horizontally
doc.image('path/to/image.png', {
  fit: [250, 300],
  align: 'center',
  valign: 'center'
});

// Add another page
doc
  .addPage()
  .fontSize(25)
  .text('Here is some vector graphics...', 100, 100);

// Draw a triangle
doc
  .save()
  .moveTo(100, 150)
  .lineTo(100, 250)
  .lineTo(200, 250)
  .fill('#FF3300');

// Apply some transforms and render an SVG path with the 'even-odd' fill rule
doc
  .scale(0.6)
  .translate(470, -380)
  .path('M 250,75 L 323,301 131,161 369,161 177,301 z')
  .fill('red', 'even-odd')
  .restore();

// Add some text with annotations
doc
  .addPage()
  .fillColor('blue')
  .text('Here is a link!', 100, 100)
  .underline(100, 100, 160, 27, { color: '#0000FF' })
  .link(100, 100, 160, 27, 'http://google.com/');

// Finalize PDF file
doc.end();

The PDF output from this example (with a few additions) shows the power of PDFKit — producing complex documents with a very small amount of code. For more, see the demo folder and the PDFKit programming guide.

Browser Usage

There are three ways to use PDFKit in the browser:

In addition to PDFKit, you'll need somewhere to stream the output to. HTML5 has a Blob object which can be used to store binary data, and get URLs to this data in order to display PDF output inside an iframe, or upload to a server, etc. In order to get a Blob from the output of PDFKit, you can use the blob-stream module.

The following example uses Browserify or webpack to load PDFKit and blob-stream. See here and here for examples of prebuilt version usage.

// require dependencies
const PDFDocument = require('pdfkit');
const blobStream = require('blob-stream');

// create a document the same way as above
const doc = new PDFDocument();

// pipe the document to a blob
const stream = doc.pipe(blobStream());

// add your content to the document here, as usual

// get a blob when you're done
doc.end();
stream.on('finish', function() {
  // get a blob you can do whatever you like with
  const blob = stream.toBlob('application/pdf');

  // or get a blob URL for display in the browser
  const url = stream.toBlobURL('application/pdf');
  iframe.src = url;
});

You can see an interactive in-browser demo of PDFKit here.

Note that in order to Browserify a project using PDFKit, you need to install the brfs module with npm, which is used to load built-in font data into the package. It is listed as a devDependency in PDFKit's package.json, so it isn't installed by default for Node users. If you forget to install it, Browserify will print an error message.

Documentation

For complete API documentation and more examples, see the PDFKit website.

License

PDFKit is available under the MIT license.

Comments
  • Port to ES6

    Port to ES6

    @devongovett I saw here and here that you want to port the Cofeescript code to ES6. That's why I would like to know if a pull request for this change would be welcome. I am willing to do it using decaffeinate. What are your thoughts?

    opened by thiamsantos 30
  • Memory leak on repeat requests to PDF rendered by server

    Memory leak on repeat requests to PDF rendered by server

    We're running into an issue rendering PDFs on the server, where each rendered PDF seems to be creating a memory leak.

    Here's a small demo Express server that demonstrates the issue: https://gist.github.com/adamperelman/f80c6f8afcc90753187d

    The memory allocated by the server increases with every request.

    opened by adamperelman 27
  •  Cannot find module './zlib_bindings'

    Cannot find module './zlib_bindings'

    node v0.6.1 pdfkit v0.1.6

    Code:

    var pdf = require('pdfkit');
    

    Error log:

    Error: Cannot find module './zlib_bindings'
        at Function._resolveFilename (module.js:334:11)
        at Function._load (module.js:279:25)
        at Module.require (module.js:357:17)
        at require (module.js:368:17)
        at Object.<anonymous> (/home/user/share/test_pdfkit/node_modules/pdfkit/node_modules/flate/lib/zlib.js:1:80)
        at Module._compile (module.js:432:26)
        at Object..js (module.js:450:10)
        at Module.load (module.js:351:31)
        at Function._load (module.js:310:12)
        at Module.require (module.js:357:17)
    
    opened by zxcabs 26
  • PDF not printable

    PDF not printable

    First of all: Great Library. Thank you for that. It was really easy to generate some decent PDFs. Unfortunately some strange errors are happening when i try to print them. One Printer in my office freezes as soon as i try to print a generated pdf, another one acts like he is printing but does not produce anything. (Not even put a paper through)

    Both Printers are working fine when i print anything else. The problem occurs when i open an pdf I generated with doc.write() same as when i use doc.output() to write the code straight to to an http response.

    I tried to compare the data of another pdf which is printing with no problems, but couldn't find anything suspicious. Anyone with same experiences or even a solution?

    Thanks!

    opened by ghost 22
  • RegisterFont with many fonts only uses first registered font

    RegisterFont with many fonts only uses first registered font

    Howdy folks!

    First off, i have to say how much i LOVE this platform.

    My question is related to registering fonts. It would seem that when I register a custom font (.ttf) only the first declared font is used, even when I reference other registered fonts.

    This is my code:

    PDFDocument = require 'pdfkit'
    fs =  require 'fs'
    
    doc_options =
        size: 'letter'
        layout: 'landscape'
        margin: 18
        Title: 'Factsheet'
        Author: 'WBN'
        fontSize: 12
    
    doc = new PDFDocument doc_options 
    doc.pipe fs.createWriteStream('test.pdf') 
    
    doc.registerFont('Thin',  '../assets/fonts/3107C8_C_0.ttf', 'Fabrikat')
    doc.registerFont('Body',  '../assets/fonts/3107C8_A_0.ttf', 'Fabrikat')
    doc.registerFont('Bold',  '../assets/fonts/3107C8_8_0.ttf', 'Fabrikat')
    doc.registerFont('Black', '../assets/fonts/3107C8_0_0.ttf', 'Fabrikat')
    
    doc.font('Thin')
        .text('Testing Body copy', 16, 100)
    
    doc.font('Body', 20)
        .text('Testing Bold copy')
        .stroke(1)
    
    doc.font('Bold', 30)
        .text('Testing Black copy')
    
    doc.font('Black', 40)
        .text('Testing Black copy')
    
    # Finalize PDF file
    doc.end()
    

    I set some options, build the new PDF, register my fonts, then create some VERY simple blocks of text.

    In the example above, ALL FOUR fonts are rendered using the "Thin" font file. It would seem that registered fonts only allow one font to be registered at a time. I can't believe that this is the case for such an established platform. Certainly I must be doing something wrong.

    I saw a reference to clearing the font cache, but that was from 2014, I would think that that would have been solved by now.

    Can anyone help?

    opened by greyskymedia 21
  • doc.end() callback?

    doc.end() callback?

    Is there a way to get a callback after everything asynchronous is finished and the file is completely stored to the file system?

    I can't find a way. Probably I am missing something?

    opened by chrisspiegl 21
  • Error: ENOENT: no such file or directory, open '//data.trie'

    Error: ENOENT: no such file or directory, open '//data.trie'

    Question

    Error while loading

    How to solve this? Error: ENOENT: no such file or directory, open '//data.trie'

    Code sample

    const PDFDocument = require('pdfkit'); const fs = require('fs'); const doc = new PDFDocument();

    export class PdfStreamDataService { constructor() { }

    public execute = function () {
    
            doc.pipe(fs.createWriteStream('out.pdf'));
            // Set some meta data
            doc.info['Title'] = 'Test Document';
            doc.info['Author'] = 'Test name';
    
            // Register a font name for use later
            // doc.registerFont('Palatino', 'fonts/PalatinoBold.ttf');
    
            var loremIpsum =
            'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus nec hendrerit felis. Morbi aliquam facilisis risus eu lacinia. Sed eu leo in turpis fringilla hendrerit. Ut nec accumsan nisl. Suspendisse rhoncus nisl posuere tortor tempus et dapibus elit porta. Cras leo neque, elementum a rhoncus ut, vestibulum non nibh. Phasellus pretium justo turpis. Etiam vulputate, odio vitae tincidunt ultricies, eros odio dapibus nisi, ut tincidunt lacus arcu eu elit. Aenean velit erat, vehicula eget lacinia ut, dignissim non tellus. Aliquam nec lacus mi, sed vestibulum nunc. Suspendisse potenti. Curabitur vitae sem turpis. Vestibulum sed neque eget dolor dapibus porttitor at sit amet sem. Fusce a turpis lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;\nMauris at ante tellus. Vestibulum a metus lectus. Praesent tempor purus a lacus blandit eget gravida ante hendrerit. Cras et eros metus. Sed commodo malesuada eros, vitae interdum augue semper quis. Fusce id magna nunc. Curabitur sollicitudin placerat semper. Cras et mi neque, a dignissim risus. Nulla venenatis porta lacus, vel rhoncus lectus tempor vitae. Duis sagittis venenatis rutrum. Curabitur tempor massa tortor.';
    
            // Draw some text wrapped to 412 points wide
            doc
            .text('And here is some wrapped text...', 100, 300)
            .font('Helvetica', 13)
            .moveDown()
            .text(loremIpsum, {
                // move down 1 line
                width: 412,
                align: 'justify',
                indent: 30,
                paragraphGap: 5
            });
            
            doc.end();
    }
    

    }

    Your environment

    • pdfkit version: 0.10.10
    • Node version: v10.16.0
    • Browser version (if applicable): npm start
    • Operating System: window 10 64bit
    opened by stanurio2017 20
  • Encryption and access privileges

    Encryption and access privileges

    This pull request adds encryption and security features defined in PDF spec v1.3, v1.4, v1.6 and v1.7 ExtensionLevel 3. This PR fixes #16.

    It adds an encryption dictionary for access privileges and the following encryption methods on content:

    • 40-bit RC4 (PDF 1.3)
    • 128-bit RC4 (PDF 1.4 and 1.5)
    • 128-bit AES (PDF 1.6 and 1.7)
    • 256-bit AES (PDF 1.7 ExtensionLevel3)
    opened by zesik 20
  • TypeError: fs.readFileSync is not a function

    TypeError: fs.readFileSync is not a function

    Uncaught (in promise) TypeError: fs.readFileSync is not a function at eval (/node_modules/unicode-properties/index.js:18) at dynamic-import.js?hash=c420b875134db38cac8a36cedf5da29f6d9ae7d2:138 at fileEvaluate (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:346) at Module.require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:248) at require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:268) at eval (/node_modules/fontkit/index.js:32) at dynamic-import.js?hash=c420b875134db38cac8a36cedf5da29f6d9ae7d2:138 at fileEvaluate (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:346) at Module.require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:248) at require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:268) at eval (/node_modules/pdfkit/js/pdfkit.js:17) at dynamic-import.js?hash=c420b875134db38cac8a36cedf5da29f6d9ae7d2:138 at fileEvaluate (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:346) at Module.require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:248) at Module.moduleLink [as link] (modules.js?hash=7a7d0648bba19b26317e6ff4e14880a0f7697d17:336) at eval (PreviewPaper.jsx:1)

    opened by KharareManisha555 18
  • Table support

    Table support

    Table support (#29) that @giuseppe-santoro made available, with small adjustments to make it run with PDFKIT:master (for my use at least)

    All credits belong to @giuseppe-santoro

    opened by sanderboom 17
  • Problems with zlib

    Problems with zlib

    When trying to write PDF document I get following error:

    
    TypeError: Object # has no method 'deflate' at 
    PDFReference.finalize (/usr/local/lib/node/.npm/pdfkit/0.1.5/package/lib/reference.coffee:54:33)
    
    
    

    Here's the line in reference.coffee:

    
    data = new Buffer(data.charCodeAt(i) for i in [0...data.length])
    compressedData = zlib.deflate(data)
    
    

    I've checked object zlib and it has the method 'deflate' but it named 'Deflate' now (with capitalised first letter). Versions: [email protected], [email protected]

    bug  opened by olifer 17
  • add content of existing pdf into pdfDocument object

    add content of existing pdf into pdfDocument object

    Question

    Description

    I am having requirement of writing existing pdffile. For i.e. i have one pdf file (one.pdf) and it has content of 2 pages(pdf might include images and text). So i want to use this content into new pdfdocument object and also need to add few other content. and new pdf should have the content old pdf file (one.pdf) and other content that i have added as per my requirement.

    Your environment

    • pdfkit version: ^0.13.0
    • Node version: 16
    • Browser version (if applicable):
    • Operating System: linux
    opened by Nitin302335 0
  • HTML to design PDF pages

    HTML to design PDF pages

    Feature Request

    Able to design the pdf pages with HTML and CSS with dynamic content.

    Feature description

    It's hard to code the pdfs when we have a ton of dynamic data. Creating tables is necessary and surely Pdfkit provides it. However, it would be great if Pdfkit would support html syntax for the pdfs out of the box and no need to do any additional stuff. We can use plain syntax of html to structure to align the page. also adding the CSS would be cherry on top

    There is a package called pdf-node which does just that. However, we don't have the option to create new page and break the content according to our will. However, I might be incorrect and missing something while providing the information, if you are aware about this stuff, please let me know. Thanks

    opened by harsh-haria 0
  • Current page number

    Current page number

    Feature Request

    Add a currentPageNumber property on PDFDocument

    Feature description

    I had trouble setting up a multipage pdf layout because I couldn't find an easy way to determine the page number on which the cursor is located.

    I had to find an abstraction on the use of a private variable of PDFKit to get around this problem.

      getCurrentPageNumber(): number {
        const pageBuffer: PDFKit.PDFPage[] = (this.doc as any)._pageBuffer
        const currentPage = this.doc.page
        let currentPageNumber: number | null = null
        pageBuffer.forEach((page: PDFKit.PDFPage, i: number) => {
          if (page === currentPage) {
            currentPageNumber = i
          }
        })
        if (currentPageNumber === null) {
          throw new Error('Unable to get current page number')
        }
        return currentPageNumber
      }
    

    It would be interesting to add the currentPageNumber property on PDFDocument for a more accessible api.

    opened by Vincent-Maret 0
  • How do you transform a Buffer into a PDF?

    How do you transform a Buffer into a PDF?

    I have this API *function I'm calling and awaiting the response:

    *Note I'm using TypeScript, although not sure it matters

    I get the reponse and just want to convert it to a PDF.

        const resp: any = await this.webmerge.mergeDocument(
           '977350',
           'sz72p3', 
           quoteLetterPayload,
    	   this.dsConfig.services.webmerge.testMode,
    	   1
        );
        
    	const pdf: any = new PDFDocument({ size: 'LETTER', bufferPages: true });
    
         pdf.pipe(resp);
    
    	 pdf.end();
    

    Your environment

    • pdfkit version: ^0.13.0
    • Node version: >=12.0.0
    • Browser version (if applicable):
    • Operating System:
    opened by antonioOrtiz 0
  • Bump qs from 6.5.2 to 6.5.3

    Bump qs from 6.5.2 to 6.5.3

    Bumps qs from 6.5.2 to 6.5.3.

    Changelog

    Sourced from qs's changelog.

    6.5.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] utils.merge: avoid a crash with a null target and a truthy non-array source
    • [Fix] correctly parse nested arrays
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Refactor] utils: reduce observable [[Get]]s
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Refactor] parse: only need to reassign the var once
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] always use String(x) over x.toString()
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 298bfa5 v6.5.3
    • ed0f5dc [Fix] parse: ignore __proto__ keys (#428)
    • 691e739 [Robustness] stringify: avoid relying on a global undefined (#427)
    • 1072d57 [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 12ac1c4 [meta] fix README.md (#399)
    • 0338716 [actions] backport actions from main
    • 5639c20 Clean up license text so it’s properly detected as BSD-3-Clause
    • 51b8a0b add FUNDING.yml
    • 45f6759 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • f814a7f [Dev Deps] backport from main
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Releases(v0.13.0)
    • v0.13.0(Oct 24, 2021)

    • v0.12.1(Jul 1, 2021)

    • v0.12.0(Apr 10, 2021)

      • Add support for Embedded Files and File Attachment Annotations
      • Accessibility support
      • Replace integration tests by visual regression tests
      • Fix access permissions in PDF version 1.7ext3
      • Fix Buffer() is deprecation warning
      • Add forms.md to generate documentation files
      • Fix "@" in FontName
      Source code(tar.gz)
      Source code(zip)
      pdfkit.standalone.js(2.47 MB)
    • v0.11.0(Jun 30, 2020)

      • Fix infinite loop when an individual character is bigger than the width of the text.
      • Fix infinite loop when text is positioned after page right margin
      • Allow links in continued text to be stopped by setting link to null
      • Add support to interlaced PNG files
      • Do not emit _interopDefault helper in commonjs build
      • Fix gradient with multiple stops (#1045)
      • Set link annotation flag to print by default
      • Add support for AcroForms
      • Drop support for (uncommon) cid less fonts on standalone build (reduces bundle size)
      Source code(tar.gz)
      Source code(zip)
      pdfkit.standalone.js(2.46 MB)
    • v0.10.0(Jun 6, 2019)

    • v0.8.0(Aug 26, 2016)

      Switches the font engine from an internal one to fontkit, an advanced text shaping engine I've been working on for a while. For PDFKit, this means the following features and improvements:

      • Support for OpenType (CFF), WOFF, and WOFF2 fonts. Previously PDFKit only supported TTF, DFont, and TTC fonts.
      • Support for advanced text layout features, including ligatures, kerning, and other advanced glyph substitutions and positioning adjustments.
      • Support for OpenType GSUB and GPOS tables, and script specific shapers (currently Arabic and Hangul shapers are included).
      • Support for Apple Advanced Typography (morx) substitutions.
      • Support for kerning built-in PDF fonts using data from AFM files.
      • Support for vertical positioning adjustments, e.g. for accents on non-composite glyphs.
      • Fonts are now embedded as CID fonts, meaning support for large character sets like CJK scripts is much improved.

      PDFKit's API remains almost exactly the same, the changes are entirely under the covers. The only addition is a new features option to the doc.text method, which can be used to apply custom OpenType features to the text. If given, it should be an array of OpenType feature tags. Most of the time, this is unnecessary as the script shaper will automatically apply required features.

      Source code(tar.gz)
      Source code(zip)
      pdfkit.js(1.83 MB)
      pdfkit.js.map(1.49 MB)
    • v0.7.1(Mar 26, 2015)

      This is a fairly minor release. It includes the following fixes and improvements:

      • #331 Diminishing left-margin when inserting lists. Thanks @laszbalo.
      • #343 Fixed wrong XRef size. Thanks @denyskoch.
      • #377 Fixed regression caused by CoffeeScript 1.9.0+. Thanks @leesdolphin.
      • #375 Refactors PDF object representation of strings and buffers. Thanks @Nathanaela.

      A precompiled version is attached to the release.

      Source code(tar.gz)
      Source code(zip)
      pdfkit.js(1.21 MB)
      pdfkit.js.map(822.59 KB)
    • v0.7.0(Sep 15, 2014)

      This is a big release. I'd like to thank the contributors listed below for making this possible!

      • Adds support for an optional page buffering feature where you can go back to previous pages to add things like page numbers. Thanks to @ef4. See #302 for the PR, and here for some docs.
      • Fixes indent with the continued option for text. Thanks @ef4. See #300.
      • Fixes center-aligned text with the characterSpacing option. Thanks again @ef4. See #301.
      • Works around missing ascender in ZapfDingbats font. Thanks @ef4. See #303.
      • Fixes an infinite loop when the first word of a text call is longer than the space available in the line. @ef4 again (this guy is awesome!). See #309.
      • Avoids unnecessarily breaking inside words when using continued. @ef4 deserves a medal. See #308.
      • Fixes TTF parsing when PDFKit is minified. Thanks to @yelouafi for this one. See #306.
      Source code(tar.gz)
      Source code(zip)
      pdfkit.js(1.21 MB)
      pdfkit.js.map(822.58 KB)
    • v0.6.5(Aug 29, 2014)

    • v0.6.4(Aug 27, 2014)

    • v0.6.3(Jul 29, 2014)

    • v0.6.2(May 10, 2014)

      • Fixes dependencies for browser demo (brfs broke something in a new version). PR #234
      • Support base64 images - useful in the browser. PR #235
      • Improves underlines for small font sizes. PR #237
      • Removes text state tracking since it wasn't working. Fixes #224. PR #238

      Thanks to @ryanwersal for these contributions!

      Source code(tar.gz)
      Source code(zip)
      pdfkit.js(1.16 MB)
      pdfkit.js.map(761.52 KB)
    • v0.6.1(Apr 14, 2014)

    • v0.6.0(Apr 14, 2014)

    Owner
    📃 Typography and Page Layout in JavaScript
    null
    New tab browser extension (aka startpage) with nord colors and a dancing goose.

    Nordic goose Nordic goose is a new tab extension (aka startpage) with nord colors and a dancing goose. Features: ?? Look at a dancing goose ?? Beautif

    PrettyCoffee 9 Dec 30, 2022
    🤖 GPU accelerated Neural networks in JavaScript for Browsers and Node.js

    brain.js GPU accelerated Neural networks in JavaScript for Browsers and Node.js About brain.js is a GPU accelerated library for Neural Networks writte

    brain.js 13.4k Jan 7, 2023
    A pure JavaScript implementation of git for node and browsers!

    isomorphic-git isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It can read

    isomorphic-git 6.7k Jan 4, 2023
    Lightweight operating system using Node.js as userspace

    NodeOS Lightweight operating system using Node.js as userspace. NodeOS is an operating system built entirely in Javascript and managed by npm. Any pac

    NodeOS 6.8k Dec 30, 2022
    Streaming torrent client for node.js

    peerflix Streaming torrent client for Node.js npm install -g peerflix Usage Peerflix can be used with a magnet link or a torrent file. To stream a vi

    Mathias Buus 6k Dec 29, 2022
    Node module for creating dat compatible tools on file systems

    dat-node dat-node is a high-level module for building Dat applications on the file system. For a lower-level API for building your own applications, u

    Dat Project 507 Nov 18, 2022
    Graph theory (network) library for visualisation and analysis

    Cytoscape.js Graph theory (network) library for visualisation and analysis : https://js.cytoscape.org Description Cytoscape.js is a fully featured gra

    Cytoscape Consortium 8.9k Jan 9, 2023
    A modular geospatial engine written in JavaScript

    A modular geospatial engine written in JavaScript turfjs.org Turf is a JavaScript library for spatial analysis. It includes traditional spatial operat

    turf 7.6k Jan 3, 2023
    IPFS implementation in JavaScript

    The JavaScript implementation of the IPFS protocol Upgrading from <=0.40 to 0.48? See the release notes for the list of API changes and the migration

    IPFS 7.2k Jan 8, 2023
    A JavaScript implementation of Git.

    JS-Git This project is a collection of modules that helps in implementing git powered applications in JavaScript. The original purpose for this is to

    Tim Caswell 3.8k Dec 31, 2022
    A full stack for bitcoin and blockchain-based applications

    Bitcore Infrastructure to build Bitcoin and blockchain-based applications for the next generation of financial technology. Getting Started Requirement

    BitPay 4.5k Jan 4, 2023
    Yet another Linux distribution for voice-enabled IoT and embrace Web standards

    YodaOS is Yet another Linux Distribution for voice-enabled IoT and embrace Web standards, thus it uses JavaScript as the main application/scripting la

    YODAOS Project 1.2k Dec 22, 2022
    Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery

    webcat Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery We a

    Mathias Buus 428 Dec 30, 2022
    A JavaScript PDF generation library for Node and the browser

    PDFKit A JavaScript PDF generation library for Node and the browser. Description PDFKit is a PDF document generation library for Node and the browser

    null 8.5k Jan 2, 2023
    ⚡️The Fullstack React Framework — built on Next.js

    The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

    ⚡️Blitz 12.5k Jan 4, 2023
    I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certificate. I use node-signpdf and pdf-lib library.

    pdf-digital-signature-with-node-signpdf-ejs I'm trying to create simple program for adding the digital signature to a pdf file with self-signed certif

    null 5 Dec 25, 2022
    PDF.js Read Only is an additional readonly mode for PDF.js

    PDF.js Read Only PDF.js Read Only is an additional readonly mode for PDF.js, a Portable Document Format (PDF) viewer that is built with HTML5 which is

    Aprillio Latuminggi 19 Dec 22, 2022
    Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

    JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

    Svante Jonsson IT-Högskolan 3 May 18, 2022
    Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

    Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

    null 4 May 3, 2022
    Kurs-repo för kursen Webbserver och Databaser

    Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

    null 14 Jan 3, 2023