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
Open VS Code.
Go to Extensions View: Click on the Extensions view icon in the Sidebar or press Ctrl+Shift+X.
Search for "jsPDF & PDF.js Snippets Extension".
Click Install to add the extension to your VS Code environment.
Usage
Open a JavaScript File: Ensure you are editing a JavaScript file where you want to use the snippets.
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:
You are not able to Customization snippents in this version wait for next verison. Plz: