1.0.3 • Published 3 years ago

filepond-plugin-pdf-convert v1.0.3

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

PDF convert to image plugin for FilePond

License: MIT npm version

The PDF Convert plugin is an Extenxion of FilePond that will convert a PDF file into an image. It will use library PDF.js.

Quick Start

Requirement:

Install using npm:

npm install filepond-plugin-pdf-convert

Or install using Yarn:

yarn add filepond-plugin-pdf-convert

Or using a CDN refernce:

https://unpkg.com/filepond-plugin-pdf-convert/dist/filepond-plugin-pdf-convert.min.js

Then import in your project:

import * as FilePond from "filepond";
import FilePondPluginPdfConvert from "filepond-plugin-pdf-convert";

Or reference it by CDN

<script src="https://unpkg.com/filepond-plugin-pdf-convert/dist/filepond-plugin-pdf-convert.min.js"></script>

Register the plugin:

FilePond.registerPlugin(FilePondPluginPdfConvert);

Create a new FilePond instance as normal.

const pond = FilePond.create({
  name: "filepond",
});

// Add it to the DOM
document.body.appendChild(pond.element);

The conversion will become active when uploading a PDF file.

Change the defaults

If you want you can change the defaults for this plugin

in the javascript

pond.setOptions({
    pdfConvertType: 'image/png',
    pdfConvertMarginHeight: 60
 });

or in the html with the 'data-' atributes in the html tag

<input type="file"
    data-pdf-convert-type="image/png"
    data-pdf-convert-margin-height="60"
/>

View the demo

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago