Skip to content
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

Wont work in linux #205

Closed
YashjeetAlaan opened this issue Jul 5, 2024 · 2 comments
Closed

Wont work in linux #205

YashjeetAlaan opened this issue Jul 5, 2024 · 2 comments

Comments

@YashjeetAlaan
Copy link

I am doing below things
const convert = fromBuffer(pdfBuffer, options);
const result = await convert(1, { responseType: 'buffer' });
result is {"buffer":[]}

My docker file
FROM node:20.9.0-alpine3.18

RUN apk update
&& apk add --no-cache make g++ python3 ghostscript graphicsmagick ghostscript-fonts
WORKDIR /api
COPY functions /api
RUN npm install -g [email protected]
RUN npm ci
COPY .sh /bin/
RUN chmod 755 /bin/
.sh
CMD /bin/worker_start.sh

It works fine in mac
But when we deployed code to linux container it simple wont work

@mskec
Copy link
Collaborator

mskec commented Jul 9, 2024

Hi @YashjeetAlaan,

I just tried running it in docker based on your Dockerfile and I got the expected output.

❯ docker run pdf2pic-docker
{
  buffer: <Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 04 00 00 00 05 2d 08 00 00 00 00 47 33 69 03 00 00 00 09 70 48 59 73 00 00 00 48 00 00 00 48 00 ... 308239 more bytes>,
  size: '1024x512',
  page: 1
}

Please check the PR #206 for the exact Dockerfile I used.

@mskec mskec closed this as completed Jul 9, 2024
@cesargdm
Copy link

cesargdm commented Aug 3, 2024

I tried the above but didn't work. I ended up using inkscape with https://github.com/papandreou/node-inkscape at v2 (not v3), in case that it works for someone, that library also supports streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants