Coder Social home page Coder Social logo

Empty string output about pdf2image HOT 7 OPEN

yakovmeister avatar yakovmeister commented on June 3, 2024 2
Empty string output

from pdf2image.

Comments (7)

kuzdogan avatar kuzdogan commented on June 3, 2024 4

Ok this is dumb but I actually didn't install the dependencies ghostscript and graphicsmagick 🤦. Now it works. Just install it as here.

Unfortunately I won't be able to use the library since I'll use it in a Google Cloud Function. If you are looking for an alternative like me you can use external API's such as cloudconver

from pdf2image.

Suraj59 avatar Suraj59 commented on June 3, 2024 3

is there any update regarding the issue? guys, it's working fine before now it's broken.

from pdf2image.

simaybocu avatar simaybocu commented on June 3, 2024 2

Ok this is dumb but I actually didn't install the dependencies ghostscript and graphicsmagick facepalm. Now it works. Just install it as here.
Unfortunately I won't be able to use the library since I'll use it in a Google Cloud Function. If you are looking for an alternative like me you can use external API's such as cloudconver
2022-04-19 (6)
When I try to install the ghostscript4js package it gives this error. What could it be from? Can you please help?

I think I was referring to the Ubuntu packages: https://github.com/yakovmeister/pdf2image/blob/master/docs/gm-installation.md Follow the Windows instructions there

yes, I installed both under C:\Program Files, but it still doesn't work, base64 is an empty string :(( Do you know a different package with a similar function?

from pdf2image.

kuzdogan avatar kuzdogan commented on June 3, 2024

I also have the same issue. Here's my code

  let res = await fetch(url);
  let buffer = await res.buffer();

  const options = {
    width: 2550,
    height: 3300,
    density: 330,
    savePath: "./output/from-buffer-to-base64"
  }

  // let convert = fromPath('pdf.pdf', options);
  let convert = fromBuffer(buffer, options);
  console.log(convert)

  let output = await convert(1, true)
  console.log('output')
  console.log(output)

  let base64 = output.base64;
  console.log('base64')
  console.log(base64)

fetch is the npm library node-fetch here.

See the console outputs:

[Function: r] {
  bulk: [Function],
  setOptions: [Function],
  setGMClass: [Function]
}
output
{ base64: '', size: '2550x3300', page: 1 }
base64

Edit: Does not work with the specimen1.pdf or other pdf's I tried

from pdf2image.

simaybocu avatar simaybocu commented on June 3, 2024

Ok this is dumb but I actually didn't install the dependencies ghostscript and graphicsmagick 🤦. Now it works. Just install it as here.

Unfortunately I won't be able to use the library since I'll use it in a Google Cloud Function. If you are looking for an alternative like me you can use external API's such as cloudconver
2022-04-19 (6)
When I try to install the ghostscript4js package it gives this error. What could it be from? Can you please help?

from pdf2image.

kuzdogan avatar kuzdogan commented on June 3, 2024

Ok this is dumb but I actually didn't install the dependencies ghostscript and graphicsmagick facepalm. Now it works. Just install it as here.
Unfortunately I won't be able to use the library since I'll use it in a Google Cloud Function. If you are looking for an alternative like me you can use external API's such as cloudconver
2022-04-19 (6)
When I try to install the ghostscript4js package it gives this error. What could it be from? Can you please help?

I think I was referring to the Ubuntu packages: https://github.com/yakovmeister/pdf2image/blob/master/docs/gm-installation.md Follow the Windows instructions there

from pdf2image.

AndreasSauer avatar AndreasSauer commented on June 3, 2024

Unfortunately, I also only get an empty string back. Am I doing something wrong? I have installed ghostscript and graphicsmagick. Is there anything else I should be aware of? I am currently using Windows 10.
screenshot_cmd

from pdf2image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.