Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>jsPDF & PDF.jsNew to Visual Studio Code? Get it now.
jsPDF & PDF.js

jsPDF & PDF.js

Spasrh Keshawarani

|
1,301 installs
| (0) | Free
This code snippets extension for jsPDF & PDF.js
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

jsPDF & PDF.js Snippets Extension

Overview

jsPDF & PDF.js Snippets Extension is a Visual Studio Code extension designed to enhance your productivity by providing a set of useful code snippets for working with jsPDF and PDF.js. This extension helps streamline the process of generating and manipulating PDF documents in JavaScript.

Requirement

Add the CDN of jspdf or PDF.js to use the snippets.

Features

  • jsPDF Snippets: Quickly insert jsPDF functions and methods with predefined snippets.
  • PDF.js Snippets: Easily add PDF.js code snippets for PDF rendering and manipulation.
  • Customizable: Modify existing snippets or add new ones to fit your needs.

Installation

  1. Open VS Code.
  2. Go to Extensions View: Click on the Extensions view icon in the Sidebar or press Ctrl+Shift+X.
  3. Search for "jsPDF & PDF.js Snippets Extension".
  4. Click Install to add the extension to your VS Code environment.

Usage

  1. Open a JavaScript File: Ensure you are editing a JavaScript file where you want to use the snippets.
  2. Trigger the Snippet: Type the prefix for the snippet and press Tab or Enter. For example:
    • Type text for a jsPDF text insertion snippet.
    • Type ldoc for a PDF.js rendering snippet.

Snippets

Here are some of the available snippets:

jsPDF Snippets

  • Add Text:
    • Prefix: .pdfText
    • Description: Inserts doc.text("I am Text", x-axis, y-axis); for jsPDF.
    • Usage: Type .pdfText and press Tab to expand the snippet.

PDF.js Snippets

  • Render PDF:
    • Prefix: .pdfRender
    • Description: Inserts pdfjsLib.getDocument('url').promise.then(function(pdf) { ... }); for PDF.js.
    • Usage: Type .pdfRender and press Tab to expand the snippet.

Customization

To customize or add new snippets:

  1. You are not able to Customization snippents in this version wait for next verison. Plz:
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft