node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

Unable to create pdf

Open ghost opened this issue 3 years ago • 5 comments

I am using Docker base image mhart/alpine-node. PDF creation fails with below exception

Error: spawn ./node_modules/phantomjs-prebuilt/bin/phantomjs ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

ghost avatar Sep 06 '21 10:09 ghost

Seems like you need to install phantonjs

sudo apt-get install phantomjs

Prasundas99 avatar Sep 07 '21 07:09 Prasundas99

@Prasundas99 i found multiple issue whan i install phantomjs manually.

  • Text is not rendering
  • Table size increased a lot

It is working as expected in my windows 10 OS.

ghost avatar Sep 07 '21 12:09 ghost

I had used the previous version I worked perfectly fine. Maybe something has broken with the update

Prasundas99 avatar Sep 07 '21 14:09 Prasundas99

@Prasundas99 i found multiple issue whan i install phantomjs manually.

* Text is not  rendering

* Table size increased a lot

It is working as expected in my windows 10 OS.

That is almost certainly FONT_CONFIG path and the related libraries. Take a look at this post, which hopefully covers the topic for you: https://github.com/marcbachmann/node-html-pdf/issues/547

inthegarage avatar Sep 10 '21 08:09 inthegarage

The pdf generator packages are deprecated and don't work on aws lambdas, just this new package I found.

https://www.npmjs.com/package/html-pdf-lambda

xxdannilinxx avatar Sep 15 '21 12:09 xxdannilinxx