question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Empty string output

See original GitHub issue
const options = {
    density: 300, // ppi
    format: "png",
    width,
    height
  }
  return pdf2pic.fromBuffer(buffer, options).bulk(1, true)
    .then(resizedImageBase64 => {

Hi I use your library regularly, thank you for making it.

I recently had an issue where the resizedImageBase64 above was an empty string. I was actually unable to replicate the issue on either my windows machine or within WSL… I have it running in docker with the imagemagick and ghostscript packages installed and this is where the error is occurring.

However some research showed that ghostscript might silently fail if a font is not included in the PDF and the PDF i had the issue did not have the font included that the text used. I was hoping it might be possible to pass options through to ghostscript through this library in order to test this hypothesis. Is this possible?

Thanks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

4reactions
kuzdogancommented, Jan 14, 2021

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

2reactions
simaybocucommented, Apr 22, 2022

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Empty string - Rosetta Code
An empty string is just a null terminator with no text in front. Checking if a string is empty is simple, just count...
Read more >
21.2 Validating Null and Empty Strings
An empty string is a string instance of zero length, whereas a null string has no value at all. An empty string is...
Read more >
Test if a command's output is an empty string and print its ...
The -n test will check if $output is a non-empty string. If it is, the content of $output will be printed. Otherwise, a...
Read more >
Empty string - Wikipedia
In formal language theory, the empty string, or empty word, is the unique string of length zero. Contents. 1 Formal theory; 2 Use...
Read more >
How to check for an empty string in Python? - Studytonight
In this article we will try different ways to check for an empty string or blank string in python with code examples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found