After installing the pdfmake library on the app being developed by Nxt, the ./node_modules/pdfmake directory cannot run npm run build.

Asked 1 years ago, Updated 1 years ago, 101 views

Development Environment

  • Nuxt.js(Vue)
  • firebase/firestore/cloudfunctions
  • Library to question [pdfmake]

Problems

Under the directory of the installed library [pdfmake],

npm install
npm run build

I would like to run , but I get the following error when running npm run build.

Module not found:Error: Can't resolve'./src'in'/Users/***

In order to translate PDF output into Japanese, it is necessary to rebuild it, but if you know the cause or solution, please let me know.

Details of questions

It is an application under development at Nxt.js and has the function of outputting data PDF.
At that time, I am using a pdfmake library, but I need to read a font that can display Japanese full-width numbers and symbols, and after researching various methods, I found the following articles.

PDF file generation using custom fonts

in pdfmake

I was able to apply the desired Japanese font using this method.
If you actually install pdfmake on a project and try to apply Japanese fonts,
Error rebuilding pdfmake library

This article was used as a reference when installing pdfmake on the project.

Apply Japanese fonts with pdfmake

Even though the pdfmake cloned from github was successfully npm run build, I am not sure if the pdfmake library installed with the npm install pdfmake command on the project will fail.

I would appreciate it if you could give me advice if you know anything.
Thank you for your cooperation.

node.js npm nuxt.js pdf

2022-09-30 17:10

1 Answers

Here, after all,

npm run build

could not be run, but

You can now use the new font by creating a new vfs_fonts.js, placing it in any directory, and IMPORTing it with reference to PDFMAKE official document.


2022-09-30 17:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.