hajareshyam / pdf-creator-node

This package is used to generate HTML to PDF in Nodejs
MIT License
239 stars 79 forks source link

Not Working in linux environment #51

Open Shubhamdutta2000 opened 3 years ago

Shubhamdutta2000 commented 3 years ago

It is working perfectly in the windows and mac OS.

But when I use this in Linux environment it throws some error (I will attach the error below) that's why my PDF is not created and my node server crashes.

error

basaltedr commented 2 years ago

i have the same problem with docker container

ashish-garg-25 commented 1 year ago

I am facing same issues. Did you get any solutions? Would really appreciate any suggestions @dieyne @Shubhamdutta2000

basaltedr commented 1 year ago

@ashish-garg-25 In my memory I think I solved it with the following lines And I put these lines in my dockerfile, for your case I imagine with Linux you may need to install these packages.


ENV PHANTOMJS_VERSION=2.1.1
ENV PHANTOMJS_PATH=/usr/local/bin/phantomjs
RUN apk update && apk add --no-cache fontconfig curl curl-dev && \
    cd /tmp && curl -Ls https://github.com/dustinblackman/phantomized/releases/download/${PHANTOMJS_VERSION}/dockerized-phantomjs.tar.gz | tar xz && \
    cp -R lib lib64 / && \
    cp -R usr/lib/x86_64-linux-gnu /usr/lib && \
    cp -R usr/share /usr/share && \
    cp -R etc/fonts /etc && \
    curl -k -Ls https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 | tar -jxf - && \
    cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
ashish-garg-25 commented 1 year ago

okay! thanks @dieyne

ghost commented 1 year ago

Hi @ashish-garg-25, did @dieyne solution work? We are facing a similar problem on alpine Linux.