-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass PDF file as a Buffer #69
Comments
Getting the same error. +1! |
I have the same issue. I am working on a next.js project and try to use this library in a route handler. It works perfectly fine in development mode. As soon as I build the project, I get the same error. I could find out where the error gets triggered, but don't understand why. This is line triggers it: const fontDataPath = path.join( path.resolve(require.resolve('pdfjs-dist'), '../../standard_fonts'), '/') https://github.com/opengovsg/pdf2md/blob/master/lib/util/pdf.js#L19 |
I managed to solve this by updated the /** @type {import('next').NextConfig} */
const config = {
experimental: {
serverComponentsExternalPackages: ['@opendocsg/pdf2md', 'pdfjs-dist'],
}
// ...
};
export default config; |
This isn't due to support for ArrayBuffers (it's there, and as #69 (comment) demonstrates, working as intended), but due to Webpack mangling symbols when bundling. This hence looks like a duplicate of #76, which better describes the issue. Duplicate of #76 |
Hello, thank you for your library, it's exactly what I need.
I don't know, maybe it's not bug, just me.
Describe the bug
I try to parse PDF file from Buffer, but I get following error while doing so:
This is my code:
I know it's possible to create temp file, but in my case it will be better to not create any additional files.
Thank you!
P.S: passing path as a string also doesn't work (temp files)
The text was updated successfully, but these errors were encountered: