Package Exports
- podofo.js
- podofo.js/podofo.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (podofo.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
podofo.js
podofo.js is a JavaScript interface for the PoDoFo library.
Library provides functions to parse, create and modify PDF.
Why podofo.js
Example
import PodofoModule from 'podofo.js'
const Podofo = await PodofoModule();
const document = new Podofo.Document();
const pages = document.getPages();
const page = pages.createPage(
Podofo.getPageSize(Podofo.PageSize.A4, false));
const fonts = document.getFonts();
const font = fonts.getDefaultFont();
const painter = new Podofo.Painter();
painter.setCanvas(page);
painter.setFont(font, 10);
painter.drawText("Hello world!", 0, 0);
painter.finishDrawing();
const pdf = document.save();
painter.delete();
document.delete();
API
podofo.js use WebAssembly and require loading of WebAssembly module.
import PodofoModule from 'podofo.js'
const Podofo = await PodofoModule();
All Podofo
objects created with new
must be deleted for the wasm memory to be released. All available functions can be found in TypeScript module definition file.