pdf-lib-extended 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdf-lib-extended",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "This project extends the capabilities of the pdf-lib JavaScript library by providing a set of helper functions that simplify common PDF manipulation tasks. It includes utilities for drawing and formatting text, images, and shapes within PDF documents, allowing for more advanced customization and automation. The class-based architecture, designed as a toolkit, ensures that developers can easily integrate these enhanced features into their existing workflows. With this extension, users can streamline the creation of dynamic and complex PDFs with minimal effort.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -894,10 +894,10 @@ class PDFLibExtended {
894
894
  * @param {base64} base64Image
895
895
  * @param {number} imageScale
896
896
  */
897
- addImage(x, y, base64Image, imageScale = 1) {
897
+ async addImage(x, y, base64Image, imageScale = 1) {
898
898
  if (base64Image.includes(",")) base64Image = base64Image.split(",")[1];
899
899
  let imageBytes = Uint8Array.from(atob(base64Image), c => c.charCodeAt(0));
900
- let embeddedImage = this.getPDF().embedPng(imageBytes);
900
+ let embeddedImage = await this.getPDF().embedPng(imageBytes);
901
901
  let { width, height } = embeddedImage.scale(imageScale);
902
902
  this.getCurrentPage().drawImage(embeddedImage, {
903
903
  x: x,