From 03896a1d701c7b6d66f2b56815e29aa22ae64758 Mon Sep 17 00:00:00 2001 From: Michael Antonov Date: Sat, 1 Jun 2024 11:24:12 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index e69de29..40ae3e9 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,43 @@ +# podofo.js + +podofo.js is a JavaScript interface for the [PoDoFo](https://github.com/podofo/podofo) library. + +Library provides functions to parse, create and modify PDF. + +## Buld with docker + +podofo.js is a compiled PoDoFo library to WebAssembly using Emscripten. +Docker [image](https://github.com/Antonov548/podofo.js-docker) can be used to build library from scratch. +This docker image contains minimal required tools and dependencies to build a JavaScript module. + +Check [CI pipeline](https://github.com/Antonov548/podofo.js/blob/main/.github/workflows/ci.yaml) for more details how to build library. + +## Example +Minimal example of creating PDF: + +```js + +const PodofoModule = require('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(); + +``` From 1b50900f3de42bd31164176e0c976eb2eb1312c5 Mon Sep 17 00:00:00 2001 From: Michael Antonov Date: Sat, 1 Jun 2024 11:27:16 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40ae3e9..1ec3ace 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ podofo.js is a JavaScript interface for the [PoDoFo](https://github.com/podofo/p Library provides functions to parse, create and modify PDF. -## Buld with docker +## Build with docker podofo.js is a compiled PoDoFo library to WebAssembly using Emscripten. Docker [image](https://github.com/Antonov548/podofo.js-docker) can be used to build library from scratch. From c47776f1736c885154e0d55a6b7969384f9a11e5 Mon Sep 17 00:00:00 2001 From: Michael Antonov Date: Sat, 1 Jun 2024 15:14:15 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1ec3ace..60a1617 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ This docker image contains minimal required tools and dependencies to build a Ja Check [CI pipeline](https://github.com/Antonov548/podofo.js/blob/main/.github/workflows/ci.yaml) for more details how to build library. ## Example -Minimal example of creating PDF: - ```js const PodofoModule = require('podofo.js');