You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am kind of new in javascript and Im currently working on a project where I need to add some text fields into a pdf template (it isn't designed as a form) and I saw that there were some Issues that addressed this but I haven't been able to understand how they were solved.
I basically used the code that was given in issue #129, but I still haven't been able to test the functionality of this library because I get this error message:
file:///home/ubuntu/Documents/projects/pdf-modifier/modify.js:1
import { PDFDocumentFactory, PDFDocumentWriter, StandardFonts, drawText } from 'pdf-lib';
^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'PDFDocumentWriter' not found. The requested module 'pdf-lib' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'pdf-lib';
const { PDFDocumentFactory, PDFDocumentWriter, StandardFonts, drawText } = pkg;
And whenever I try the provided solution it keeps throwing different errors.
So I was wondering, is there any existing example that shows how to work with local files instead of URLs? The one provided in the official site shows how to do It with a URL
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am kind of new in javascript and Im currently working on a project where I need to add some text fields into a pdf template (it isn't designed as a form) and I saw that there were some Issues that addressed this but I haven't been able to understand how they were solved.
I basically used the code that was given in issue #129, but I still haven't been able to test the functionality of this library because I get this error message:
And whenever I try the provided solution it keeps throwing different errors.
So I was wondering, is there any existing example that shows how to work with local files instead of URLs? The one provided in the official site shows how to do It with a URL
Beta Was this translation helpful? Give feedback.
All reactions