How to convert from PDF if Ghostscript is not installed
Posted: 2019-07-31T14:42:38-07:00
I'm trying to convert PDF to JPEG using AWS Lambda service. This means that the server where the command executes doesn't have either Imagemagick or Ghostscript installed and that I need to provide self-contained binary with my code. For certain internal reasons I have to use Imagemagick 6 for this.
I've built the binaries on a vanilla AWS Linux server from the tarballs downloaded from imagemagic.org with all sort of imaginable combinations of ... switches to configure to no avail: unless I have Ghostscript installed my convert commands return the following error:
I've built the binaries on a vanilla AWS Linux server from the tarballs downloaded from imagemagic.org with all sort of imaginable combinations of
Code: Select all
--prefix=/var/task/imagemagick --enable-shared=no --enable-static=yes --disable-installed --with-gslib=yes
Here's what configure invariably returns:convert -alpha deactivate -colorspace RGB -geometry 364 -crop 348x640+8+32 /tmp/Nxxx,2019-07-14,A,001.pdf /tmp/Nxxx,2019-07-14,A,001.jpg
convert: NoImagesDefined `/tmp/Nxxx,2019-07-14,A,001.jpg' @ error/convert.c/ConvertImageCommand/3235.
So I guess the real question here is: how to add PDF support without installing Ghostscript?Delegate Program Configuration:
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (8.70)
Font Configuration:
Apple fonts --with-apple-font-dir=default
Dejavu fonts --with-dejavu-font-dir=default /usr/share/fonts/dejavu/
Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/default/Type1/
URW-base35 fonts --with-urw-base35-font-dir=default none
Windows fonts --with-windows-font-dir=default none
X11 Configuration:
X_CFLAGS =
X_PRE_LIBS =
X_LIBS =
X_EXTRA_LIBS =
Options used to compile and link:
PREFIX = /var/task/imagemagick
EXEC-PREFIX = /var/task/imagemagick
VERSION = 6.9.10
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -I/usr/include/libpng12 -fopenmp -g -O2 -Wall -mtune=core-avx2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CPPFLAGS = -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
PCFLAGS =
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
LIBS = -ltiff -ljpeg -lpng12 -lz -lm
CXX = g++
CXXFLAGS = -pthread
FEATURES = DPC Cipher OpenMP
DELEGATES = mpeg jng jpeg png ps tiff zlib