Forum Bugs

URL image not loading into PDF

Agustin
Prince docker image cannot load url image on PDF

I executed several times on my local machine (running Prince in my OS) and everything works fine, but when i mount it into a docker container it cannot be uploaded into the PDF dynamically with an URL.

I already execute via command line with --debug flag and when it reach the images it stops and fail. Logs will be described above:

/tmp/prince-15.1-alpine3.16-x86_64 # echo '<img src="https://www.princexml.com/images/fakebox.png" />' | prince - -o testPDF.pdf -v --debug
prince: debug: init locking for OpenSSL
prince: debug: loading license: /usr/local/lib/prince/license/license.dat
prince: debug: loading /usr/local/lib/prince/license/license.dat because it is the main resource
prince: loading document: /usr/local/lib/prince/license/license.dat
prince: debug: loaded resource: /usr/local/lib/prince/license/license.dat
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/local/lib/prince/style/fonts.css
prince: debug: loaded resource: /usr/local/lib/prince/style/fonts.css
prince: debug: loaded resource: type: no
prince: debug: enabling parallel downloads
prince: Loading document...
prince: loading HTML5 input: -
prince: debug: loaded document: -
prince: debug: sniffed doctype: XHTML
prince: Applying style sheets...
prince: loading style sheet: /usr/local/lib/prince/style/common.css
prince: debug: loaded resource: /usr/local/lib/prince/style/common.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/local/lib/prince/style/html.css
prince: debug: loaded resource: /usr/local/lib/prince/style/html.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/local/lib/prince/style/hyph.css
prince: debug: loaded resource: /usr/local/lib/prince/style/hyph.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/local/lib/prince/style/mathml.css
prince: debug: loaded resource: /usr/local/lib/prince/style/mathml.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/local/lib/prince/style/svg.css
prince: debug: loaded resource: /usr/local/lib/prince/style/svg.css
prince: debug: loaded resource: type: no
prince: debug: prefetching resource: https://www.princexml.com/images/fakebox.png
prince: debug: [thread] loading https://www.princexml.com/images/fakebox.png
prince: Preparing document...
prince: loading image: https://www.princexml.com/images/fakebox.png

*** Mercury runtime: caught strange segmentation violation ***
PC at signal: 139821478707282 (7f2ab9920052)
This may have been caused by a stack overflow, due to unbounded recursion.

Docker image:

FROM node:18.12.1-alpine AS installer
RUN sh -c "echo 'http://dl-cdn.alpinelinux.org/alpine/v3.16/community' >> /etc/apk/repositories"
RUN apk add --no-cache \
libc6-compat libxml2 tiff giflib libpng libwebp 'libavif=0.10.1-r0' aom-libs lcms2 \
libjpeg-turbo libcurl libcrypto1.1 fontconfig freetype ca-certificates \
msttcorefonts-installer fontconfig pixman lcms2 libgomp \
&& update-ms-fonts \
&& fc-cache -f \
&& rm -rf /tmp/*
RUN apk update

After trying several things such as escaping &, re build the docker images several times, testing network connection and so on.... It seems that Prince did not like URLs within docker images.

Anyguess?

We are with a trial version for testing!
mikeday
The node:18.12.1-alpine Docker image appears to be based on Alpine 3.17:

https://hub.docker.com/layers/library/node/18.12.1-alpine/images/sha256-b375b98d1dcd56f5783efdd80a4d6ff5a0d6f3ce7921ec99c17851db6cba2a93?context=explore

However you have installed the Prince package for Alpine 3.16. Can you try installing the Prince package for Alpine 3.17?
Agustin
That answer solve our issue.

Thank you very much!