Giter Site home page Giter Site logo

surnet / docker-wkhtmltopdf Goto Github PK

View Code? Open in Web Editor NEW
338.0 12.0 63.0 112 KB

wkhtmltopdf for multiple base images

Home Page: https://hub.docker.com/u/surnet/

License: MIT License

Shell 100.00%
docker wkhtmltopdf wkhtmltoimage wkhtmltox node python alpine docker-image dockerfile

docker-wkhtmltopdf's Introduction

docker-wkhtmltopdf

This repo contains scripts to create docker images which will be available in multiple variants.

The purpose is to publish docker images with a working and patched wkhtmltopdf installation and keep them as small as possible while delivering all functions.

Naming

The published images follow a naming convention.

Image name

The image name follows the format:

surnet/<os>-<base>-wkhtmltopdf or surnet/<os/base>-wkhtmltopdf

  • <os> matches the underlaying os.
  • <base> matches the used base image.
  • <os/base> matches the used base image if the os and base image are the same.

e.g. surnet/alpine-node-wkhtmltopdf or surnet/alpine-wkhtmltopdf

Tags

The tags represent version numbers which follow the format:

<1>-<2>-<3>

  • <1> matches the version of the base image.
  • <2> matches the wkhtmltopdf version.
  • <3> matches the Edition (see next chapter).

e.g. 3.12.4-0.12.6-small

Editions

There are two editions available for each version.

  • small contains only wkhtmltopdf. This should be sufficient for most use-cases
  • full contains wkhtmltopdf, wkhtmltoimage and the libraries.

Available Images

surnet/alpine-wkhtmltopdf

Docker Stars Docker Pulls

This image can be used as a base for your project or directly used via bash.

For a list of available versions please see the page on Docker Hub or the GitHub Container Registry. If a version you would like is missing please open an issue on this repo.

Docker Hub

FROM surnet/alpine-wkhtmltopdf:<version>
docker run surnet/alpine-wkhtmltopdf:<version> google.com - > test.pdf

GitHub Container Registry

FROM ghcr.io/surnet/alpine-wkhtmltopdf:<version>
docker run ghcr.io/surnet/alpine-wkhtmltopdf:<version> google.com - > test.pdf

surnet/alpine-node-wkhtmltopdf

Docker Stars Docker Pulls

This image can be used as a base for your NodeJS project.

For a list of available versions please see the page on Docker Hub or the GitHub Container Registry. If a version you would like is missing please open an issue on this repo.

Docker Hub

FROM surnet/alpine-node-wkhtmltopdf:<version>

GitHub Container Registry

FROM ghcr.io/surnet/alpine-node-wkhtmltopdf:<version>

surnet/alpine-python-wkhtmltopdf

Docker Stars Docker Pulls

This image can be used as a base for your Python project.

For a list of available versions please see the page on Docker Hub or the GitHub Container Registry. If a version you would like is missing please open an issue on this repo.

Docker Hub

FROM surnet/alpine-python-wkhtmltopdf:<version>

GitHub Container Registry

FROM ghcr.io/surnet/alpine-python-wkhtmltopdf:<version>

Other Images

If you are using another image based on alpine you can use the following Dockerfile as a starting point. Just replace the openjdk:19-jdk-alpine3.16 with the alpine based image you would like to use. If you do not need wkhtmltoimage or the libs omit the last two lines. Please check if there is a newer version of surnet/alpine-wkhtmltopdf to use than the one described below.

FROM surnet/alpine-wkhtmltopdf:3.19.0-0.12.6-full as wkhtmltopdf
FROM mcr.microsoft.com/dotnet/aspnet:7.0.17-alpine3.19

# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
    libstdc++ \
    libx11 \
    libxrender \
    libxext \
    libssl3 \
    ca-certificates \
    fontconfig \
    freetype \
    ttf-dejavu \
    ttf-droid \
    ttf-freefont \
    ttf-liberation \
    # more fonts
  && apk add --no-cache --virtual .build-deps \
    msttcorefonts-installer \
  # Install microsoft fonts
  && update-ms-fonts \
  && fc-cache -f \
  # Clean up when done
  && rm -rf /tmp/* \
  && apk del .build-deps

# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/

Contribute

Please feel free to open a issue or pull request with suggestions.

Keep in mind that the build process of these container takes some (a lot of) time.

Credits

Based upon the following repos/inputs:

docker-wkhtmltopdf's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-wkhtmltopdf's Issues

docker file nodejs

hi, im create a docker file, but dont work


FROM surnet/alpine-node-wkhtmltopdf:16.13.1-0.12.6-small


WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "index.js" ]

but i have this error

image

Progress stuck on 10% when running on Mac

My specs:

image

Minimal steps to reproduce:

$ docker run -it surnet/alpine-python-wkhtmltopdf:3.8.5-0.12.6-small-alpine12 sh
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/ # wkhtmltopdf google.com google.pdf
Loading pages (1/6)
[======>                                                     ] 10%

I just tried the same on a Linux laptop (Linux Mint 20.1 Cinnamon), as well as in this Mac (in the host, not the container) and was able to execute without any hiccups:

$ wkhtmltopdf --version
wkhtmltopdf 0.12.6 (with patched qt)
$ wkhtmltopdf google.com google.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

Upon further debugging, executing the non-python version of this image seems to work just fine:

$ docker run -it --entrypoint sh surnet/alpine-wkhtmltopdf:3.13.5-0.12.6-small
/ # wkhtmltopdf google.com test.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

For completion's sake here's my project's Docker related information:

My Dockerfile:

FROM surnet/alpine-python-wkhtmltopdf:3.8.5-0.12.6-small-alpine12

# set work directory
WORKDIR /usr/src/web

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
RUN apk update \
  && apk add postgresql-dev gcc python3-dev musl-dev \
# install Pillow dependencies
     gcc jpeg-dev zlib-dev

# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# copy project
COPY . .

# run entrypoint.sh
ENTRYPOINT ["/usr/src/web/entrypoint.sh"]

My docker-compose.yml file

version: '3.7'

services:
  web:
    build: ./web
    command: python manage.py runserver 0.0.0.0:80
    volumes:
      - ./web/:/usr/src/web/
      - media_volume:/usr/src/web/media
    ports:
      - 8000:80
    env_file:
      - ./env/.env.dev
  db:
    image: postgres:12.0-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_DB=<snip>
      - POSTGRES_USER=<snip>
      - POSTGRES_PASSWORD=<snip>
volumes:
  postgres_data:
  media_volume:

Steps to replicate on my project:

$ docker-compose up -d --build
$ docker-compose exec web sh
/usr/src/ # ./wkhtmltopdf google.com test.pdf
Loading pages (1/6)
[======>                                                     ] 10%

Please let me know if I need to provide more information. Thank you for this project!

Not working for wodby/drupal image

FROM surnet/alpine-wkhtmltopdf:3.9-0.12.5-full as wkhtmltopdf
FROM wodby/drupal-php:7.4-dev-4.15.3

# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
  libstdc++ \
  libx11 \
  libxrender \
  libxext \
  libssl1.1 \
  ca-certificates \
  fontconfig \
  freetype \
  ttf-dejavu \
  ttf-droid \
  ttf-freefont \
  ttf-liberation \
  ttf-ubuntu-font-family \
&& apk add --no-cache --virtual .build-deps \
  msttcorefonts-installer \
\
# Install microsoft fonts
&& update-ms-fonts \
&& fc-cache -f \
\
# Clean up when done
&& rm -rf /tmp/* \
&& apk del .build-deps

# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/

java based images

would you be interested in adding some java based images. i would like to experiment and submit a PR

Some CSS features are not working

CSS features like flex and trasnform are not working, they only work if I put the "-webkit-" prefix. Maybe we need to update the Qt?

install into go alpine dockerfile

hi guys i love your work, any way i try to use this image on my go alpine. the dockerfile look like this

FROM surnet/alpine-wkhtmltopdf:3.16.2-0.12.6-full as wkhtmltopdf
FROM golang:1.19-alpine3.17 as builder

# add some necessary packages
RUN apk update && \
    apk add libc-dev && \
    apk add gcc && \
    apk add make && \
    mkdir /src

COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/

WORKDIR /src
COPY ./../ ./

RUN go mod vendor && go mod verify
RUN go build -o /app-bin /src/app/api/main.go

# Distribution
FROM alpine:3
RUN apk --update add tzdata

WORKDIR /srv
COPY . .
COPY --from=builder /app-bin .

EXPOSE 8080
CMD ["/srv/app-bin"]

but when i run docker build, its always return error wkhtmltopdf not found

> [builder 9/9] RUN go build -o /app-bin /src/app/api/main.go:
#0 94.29 # github.com/adrg/go-wkhtmltopdf
#0 94.29 vendor/github.com/adrg/go-wkhtmltopdf/converter.go:7:10: fatal error: wkhtmltox/pdf.h: No such file or directory
#0 94.29     7 | #include <wkhtmltox/pdf.h>
#0 94.29       |          ^~~~~~~~~~~~~~~~~
#0 94.29 compilation terminated.
------
failed to solve: process "/bin/sh -c go build -o /app-bin /src/app/api/main.go" did not complete successfully: exit code: 2

do you guys have any idea how to solve this?

Doesnt work with node js wrapper?

hi love your works, but i kinda stressed out why it is not working on my projects.
i use this wrapper: https://www.npmjs.com/package/wkhtmltopdf
and run it in windows server 2019 environment, with docker.

minimal replication:

// tes.js
var fs = require("fs");
var wkhtmltopdf = require('wkhtmltopdf');

// URL
wkhtmltopdf('http://google.com/', { pageSize: 'letter' })
  .pipe(fs.createWriteStream('out.pdf'));

my dockerfile:

FROM surnet/alpine-node-wkhtmltopdf:16.18.0-0.12.6-full AS deps

ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /app && cp -a /tmp/node_modules /app/

# Set work directory
WORKDIR /app
COPY . /app

RUN npx prisma generate
# RUN npm run swagger
# RUN npm run build

COPY ./templates /app/dist/templates

# Set the command to run your app
CMD ["npm", "run", "dev"]

my compose:

version: "3.1"

services:
  backend:
    build: "./"
    image: ppic-pil:latest
    container_name: api-ppic
    hostname: apippic
    command: sh -c "env | grep -E '^[A-Za-z_]+=' > .env && npm run dev"
    volumes:
      - "./photo:/app/photo"
      - "./pdf:/app/pdf"
      - "./signature:/app/signature"
    ports:
      - target: 9334
        published: 9334
        protocol: tcp
    env_file:
      - ./.env
    restart: always

but it return weird error and no way i could possibly know why? when i run node test.js or my project function. it is working well on native machine running ubuntu, mac, and windows but cant work properly on docker running alpine and debian. any ideas?

image

Chinese and Japanese characters not printing in 3.16.2-0.12.6-full

Hello, I'm stuck in an issue wherein the wkhtmltopdf prints just tofus for non-ascii characters (Chinese, Japanese, Korean etc). Can you please help me to resolve this issue.

My Dockerfile

FROM surnet/alpine-wkhtmltopdf:3.16.2-0.12.6-full as wkhtmltopdf

FROM ruby:3.0.5-alpine3.16

# RUN apk update -qq && apk add  nodejs  
#build-essential libssl-dev libyaml-dev -dev libreadline-dev openssl curl libcurl4 libcurl4-openssl-dev
RUN apk add --update \
  build-base \
  mariadb-dev \
  sqlite-dev \
  nodejs \
  tzdata \
  git \
  && rm -rf /var/cache/apk/*

# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
    libstdc++ \
    libx11 \
    libxrender \
    libxext \
    libssl1.1 \
    ca-certificates \
    fontconfig \
    freetype \
    ttf-dejavu \
    ttf-droid \
    ttf-freefont \
    ttf-liberation \
    # more fonts
  && apk add --no-cache --virtual .build-deps \
    msttcorefonts-installer \
  # Install microsoft fonts
  && update-ms-fonts \
  && fc-cache -f \
  # Clean up when done
  && rm -rf /tmp/* \
  && apk del .build-deps

COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
... Rest of the content

wkthmltopdf version is wkhtmltopdf 0.12.6 (with patched qt)

This is the command I use for testing in bash terminal

wkhtmltopdf --encoding utf-8 - - > ./app/test.pdf <<HTML
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style>
        body {
          font-family: sans-serif; /* Specify your preferred font family here */
          color: #eb1313;
        }
      </style>
</head>
<body>
    <p>&euro;</p>
    <p>áéíóúñö</p>
    <p>Japanese こんにちは</p>
    <p>Chinese 你好</p>
    <p>Korean 안녕</p>
    <p>Saudi Arabian Currency Symbol is &#65020;</p>
    <h1> Saudi Arabian Currency Symbol is &#65020; </h1>                    
   <h1> Indian Currency Symbol is &#8377;</h1>                             
   <H1> European euro Symbol is &#128; </h1>                               
   <h1> United States dollar symbol is &#36; </h1>                         
   <h1> Chinese Yuan Renminbi symbol is &#165; </h1>                       
   <h1> Kazakhstani tenge symbols is &#8376; </h1>  
</body>
</html>
HTML

The output pdf file prints tofu for the Japanese, Chinese and Korean languages.
test.pdf

New features of JS

Most of the js features are not working, so I have to depreciate newer features to older ones. Cannot use foreach, const, .then, async/await, .includes, and etc. If I use it, the script file is ignored on pdf generation. And cannot use another feature for some of then like .then

/bin/sh: wkhtmltopdf: not found

Below is my Dockerfile

FROM surnet/alpine-wkhtmltopdf:3.15.0-0.12.6-small as wkhtmltopdf
FROM fundingsocietiesdocker/golang:1.18.0-alpine3.15

# Set destination for COPY
WORKDIR /app
USER root


# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
    libstdc++ \
    libx11 \
    libxrender \
    libxext \
    libssl1.1 \
    ca-certificates \
    fontconfig \
    freetype \
    ttf-dejavu \
    ttf-droid \
    ttf-freefont \
    ttf-liberation \
    # more fonts
  && apk add --no-cache --virtual .build-deps \
    msttcorefonts-installer \
  # Install microsoft fonts
  && update-ms-fonts \
  && fc-cache -f \
  # Clean up when done
  && rm -rf /tmp/* \
  && apk del .build-deps

# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/
RUN chmod +x /bin/wkhtmltopdf



#for installing GCC
RUN apk add build-base

# Download Go modules
COPY go.mod .
COPY go.sum .
RUN go mod download

# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY *.go ./
COPY *.html ./

# Build
RUN go build -o /docker-gs-ping

# This is for documentation purposes only.
# To actually open the port, runtime parameters
# must be supplied to the docker command.
EXPOSE 8080

# (Optional) environment variable that our dockerised
# application can make use of. The value of environment
# variables can also be set via parameters supplied
# to the docker command on the command line.
#ENV HTTP_PORT=8081

# Run
CMD [ "/docker-gs-ping" ]

after I build the image and run it, I got below in the container -> terminal

/app # which wkhtmltopdf
/bin/wkhtmltopdf
/app # 
/app # 
/app # 
/app # wkhtmltopdf
/bin/sh: wkhtmltopdf: not found

wkhtmltopdf 0.12.5

wkhtmltopdf version 0.12.5 has been released – could you add it to this project?

Rendering is gone with patched version

Hi there, i've been trying to get wkhtmltopdf to work properly for a while now and i was struggling with package conflict while trying to get edge libraries on v3.9 to get rid of this nasty QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once QUrl error message that would segfault and not generate the pdf randomly.

Somebody suggested i copy the binary from one of your Dockerfile, which i did - i built Dockerfile_3.9-0.12.5-full and got the binary and the libs out. So far it seems to work pretty well as the pdf now renders without any segfault ever and i'm really glad about it.

But there is one drawback on this: my rendered html is totally broken. Where i had one full width page display i know have several columns like design that are totally off.

Is there any known issue with using last Qt that would explain this?

Anyways, thanks for your time and your work 👌

Help to build a docker image for net core apps

Hi, I was trying to build a docker image based in this one to run a dotnet web app and I succesfully failed!. My question is: Is it possible to build an docker image that have preinstalled wkhtmltopdf?, or at least all the libraries required by wkhtmltopdf. My idea is to take that as base and add the net runtime an my binaries. Any help is welcomed! Thank you so much in advance.

problem with aspnet:6.0-alpine base image

Hi all,
reading Other Images section script I have modified the base image with aspnet:6.0-alpine

FROM surnet/alpine-wkhtmltopdf:3.16.0-0.12.6-full as wkhtmltopdf
FROM  mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
WORKDIR /app
EXPOSE 443
# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
  libstdc++ \
  libx11 \
  libxrender \
  libxext \
  libssl1.1 \
  ca-certificates

# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
#COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage
#COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/
RUN apk update \
    && apk upgrade \
    && apk add --no-cache \
        freetype-dev \
        libpng-dev \
        jpeg-dev \
        libjpeg-turbo \
        libjpeg-turbo-dev
RUN apk add libgdiplus --repository http://dl-3.alpinelinux.org/alpine/edge/testing/
RUN apk add libc-dev libx11-dev
....

when i create the pdf file i receive this error:
"Message":"One or more errors occurred.","Data":null,"InnerException":{"ClassName":"System.NotSupportedException","Message":"Unable to load native library. The platform may be missing native dependencies (libjpeg62, etc). Or the current platform is not supported."

Can anyone help me
Thx
Stefano

font size issue for Thai language

Hi,
I tried surnet/alpine-wkhtmltopdf:3.12-0.12.6-full image and pdf is generated fine for all the languages except for Thai language. For Thai language the font is very small as compared to other languages.
I think this is the issue with wkhtmltopdf.

Getting no such file exist error while building docker with file Dockerfile_3.16.0-0.12.6-small

alpine-wkhtmltopdf git:(master) docker buildx build . -f Dockerfile_3.16.0-0.12.6-small --platform linux/amd64 --progress=plain --tag nitin:wkhtml
#1 [internal] load build definition from Dockerfile_3.16.0-0.12.6-small
#1 transferring dockerfile: 4.18kB done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/alpine:3.16.0
#3 ...

#4 [builder 1/5] FROM docker.io/library/alpine:3.16.0@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c
#4 CACHED

#5 [builder 2/5] RUN mkdir -p /tmp/patches
#5 CACHED

#6 [internal] load build context
#6 transferring context: 2B done
#6 DONE 0.0s

#7 [builder 3/5] COPY conf/* /tmp/patches/
#7 ERROR: lstat /var/lib/docker/tmp/buildkit-mount4112552787/conf: no such file or directory

#3 [internal] load metadata for docker.io/library/alpine:3.16.0
#3 ...

#8 [stage-1 2/3] RUN apk add --no-cache libstdc++ libx11 libxrender libxext libssl1.1 ca-certificates fontconfig freetype ttf-dejavu ttf-droid ttf-freefont ttf-liberation && apk add --no-cache --virtual .build-deps msttcorefonts-installer && update-ms-fonts && fc-cache -f && rm -rf /tmp/* && apk del .build-deps
#0 0.196 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
#8 CANCELED

#3 [internal] load metadata for docker.io/library/alpine:3.16.0

[builder 3/5] COPY conf/* /tmp/patches/:


ERROR: failed to solve: lstat /var/lib/docker/tmp/buildkit-mount4112552787/conf: no such file or directory

font-family ignored

I've included your wkhtmltopdf binary into one of my Alpine 3.7 based images like this:

COPY --from=surnet/alpine-wkhtmltopdf:3.7-0.12.4-small /bin/wkhtmltopdf /bin/wkhtmltopdf

It works fine so far, except for one nasty issue: It seems to ignore any font-family settings in the generated PDF. Is this a known problem? If not, any idea what I'm doing wrong or what else I could try?

More background:

I'm migrating an older Debian based application with wkhtmltopdf 0.11 to an Alpine based image. The old app works just fine, whereas the new one fails to render the correct font. The relevant part of the CSS is:

font-family: serif;
font-size:      24pt;
font-weight:    bold;
line-height:    20pt;

As I understand it, wkhtmltopdf asks fontconfig to deliver a matching font file. So far I found out, that in the end the old app uses the n021004l.pfb font file. This is the font recommended by fontconfig. The font is also available under the new app and listed there under fc-list. So I used FC_DEBUG=1 to see what wkhtmltopdf asks for and what fontconfig sends back in return.

The output is listed below. The top block seems to be the "query part" (AKA what wkhtmltopdf asks for). And the lower block (Best score ...) is, what fontconfig thinks is the best match for this query.

The weird thing is, that with 0.12.4 it always queries the same list of font families (family: "Helvetica"(s) "TeX Gyre Heros"(s) "Arial"(w)...) , no matter what I set in CSS. Whereas in the old app the query is much more in line with my CSS (family: "Times New Roman"(s) "Tinos"(s)..).

Any feedback is appreciated.

Fontconfig output from the old app

Match Pattern has 21 elts (size 32)                          ] 50%                                                      [810/1838]
        family: "Times New Roman"(s) "Tinos"(s) "Liberation Serif"(s) "Thorndale"(s) "Thorndale AMT"(s) "Tinos"(s) "Liberation Ser
if"(s) "Thorndale"(s) "Thorndale AMT"(s) "Times"(w) "TeX Gyre Termes"(w) "Nimbus Roman No9 L"(w) "TeX Gyre Termes"(w) "Nimbus Roma
n No9 L"(w) "DejaVu Serif"(w) "DejaVu LGC Serif"(w) "DejaVu LGC Serif"(w) "DejaVu Serif"(w) "DejaVu LGC Serif"(w) "Bitstream Vera 
Serif"(w) "DejaVu LGC Serif"(w) "DejaVu Serif"(w) "DejaVu Serif"(w) "Times New Roman"(w) "Thorndale AMT"(w) "Luxi Serif"(w) "Nimbu
s Roman No9 L"(w) "Times"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Kinnari"(w) "Norasi"(w) "Frank Ruehl"(w) "Dror"(w) "JG LaoTimes"(w) "S
aysettha Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narr
ow"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Mincho"(w) "SimSun"(w) "PMingLiu"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "
AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "ZYSong18030"(w) "HanyiSong"(w) "MgOpen Canonica"(w) "Sazanami Mincho"(w) "IPAMonaMin
cho"(w) "IPAMincho"(w) "Kochi Mincho"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "AR PL Zenkai Uni"(w) "MS 明朝"(w) "ZYSo
ng18030"(w) "NanumMyeongjo"(w) "UnBatang"(w) "Baekmuk Batang"(w) "KacstQura"(w) "Frank Ruehl CLM"(w) "Lohit Bengali"(w) "Lohit Guj
arati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit 
Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Rachana"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya
"(w) "LKLUG"(w) "FreeSerif"(w) "Code2000"(w) "Code2001"(w) "DejaVu Serif"(w) "DejaVu LGC Serif"(w) "Bitstream Vera Serif"(w) "Deja
Vu Serif"(w) "Times New Roman"(w) "Thorndale AMT"(w) "Luxi Serif"(w) "Nimbus Roman No9 L"(w) "Times"(w) "Artsounk"(w) "BPG UTF8 M"
(w) "Kinnari"(w) "Norasi"(w) "Frank Ruehl"(w) "Dror"(w) "JG LaoTimes"(w) "Saysettha Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Com
pset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narrow"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Mincho"(w) "S
imSun"(w) "PMingLiu"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "ZYSong180
30"(w) "HanyiSong"(w) "MgOpen Canonica"(w) "Sazanami Mincho"(w) "IPAMonaMincho"(w) "IPAMincho"(w) "Kochi Mincho"(w) "AR PL SungtiL
 GB"(w) "AR PL Mingti2L Big5"(w) "AR PL Zenkai Uni"(w) "MS 明朝"(w) "ZYSong18030"(w) "NanumMyeongjo"(w) "UnBatang"(w) "Baekmuk B
atang"(w) "KacstQura"(w) "Frank Ruehl CLM"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Ma
ithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Rachana
"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSerif"(w) "Code2000"(w) "Code2001"
(w) "serif"(w) "Nazli"(w) "Lotoos"(w) "Mitra"(w) "Ferdosi"(w) "Badr"(w) "Zar"(w) "Nazli"(w) "Lotoos"(w) "Mitra"(w) "Ferdosi"(w) "B
adr"(w) "Zar"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "Helvetica"(w) "TeX Gyre Heros"(w) "Nimbus Sans
 L"(w) "Helvetica"(w) "Times"(w) "Times"(w) "Times New Roman"(w) "Times New Roman"(w) "Times New Roman"(w) "Times New Roman"(w) "A
rial"(w) "Arimo"(w) "Liberation Sans"(w) "Albany"(w) "Albany AMT"(w) "Times New Roman"(w) "Helvetica"(w) "Times"(w) "serif"(w) "se
rif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "
serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "DejaVu Sans"(w) "DejaVu LGC Sans"(w) "DejaVu LGC Sans"(w) "Bitst
ream Vera Sans"(w) "DejaVu Sans"(w) "Verdana"(w) "Arial"(w) "Albany AMT"(w) "Luxi Sans"(w) "Nimbus Sans L"(w) "Helvetica"(w) "Luci
da Sans Unicode"(w) "BPG Glaho International"(w) "Tahoma"(w) "Nachlieli"(w) "Lucida Sans Unicode"(w) "Yudit Unicode"(w) "Kerkis"(w
) "ArmNet Helvetica"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Waree"(w) "Loma"(w) "Garuda"(w) "Umpush"(w) "Saysettha Unicode"(w) "JG Lao 
Old Arial"(w) "GF Zemen Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"
(w) "Mukti Narrow"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Gothic"(w) "UmePlus P Gothic"(w) "SimSun"(w) "PMingLiu"(w) "WenQuanYi Zen
 Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "MgOpen Moderna"(w) "MgOpen Modata"(w) "MgOpen C
osmetica"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL K
aitiM Big5"(w) "AR PL ShanHeiSun Uni"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "MS ゴシック"(w) "ZYSong18030"(w) "Nanum
Gothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim"(w) "KacstQura"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(
w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjab
i"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSans"
(w) "Arial Unicode MS"(w) "Arial Unicode"(w) "Code2000"(w) "Code2001"(w) "sans-serif"(w) "Roya"(w) "Koodak"(w) "Terafik"(w) "sans-
serif"(w) "DejaVu Sans Mono"(w) "DejaVu LGC Sans Mono"(w) "DejaVu LGC Sans Mono"(w) "Bitstream Vera Sans Mono"(w) "DejaVu Sans Mon
o"(w) "Inconsolata"(w) "Andale Mono"(w) "Courier New"(w) "Cumberland AMT"(w) "Luxi Mono"(w) "Nimbus Mono L"(w) "Courier"(w) "Miria
m Mono"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "MS Gothic
"(w) "UmePlus Gothic"(w) "NSimSun"(w) "MingLiu"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung Mono"(w) "HanyiSong"(w) "AR PL Sungti
L GB"(w) "AR PL Mingti2L Big5"(w) "ZYSong18030"(w) "NanumGothicCoding"(w) "NanumGothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmu
k Gulim"(w) "TlwgTypo"(w) "TlwgTypist"(w) "TlwgTypewriter"(w) "TlwgMono"(w) "Hasida"(w) "Mitra Mono"(w) "GF Zemen Unicode"(w) "Hap
ax Berbère"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) 
"Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit 
Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeMono"(w) "monospace"(w) "Terafik"(w) "serif"(w) "serif"(w) "serif"(
w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "serif"(w) "sans-serif"(w) "sans-serif"(w) "sans-serif"(w) "sans-serif"(
w) "sans-serif"(w) "sans-serif"(w) "serif"(w) "monospace"(w) "sans-serif"(w) "serif"(w)
        familylang: "en"(s) "en-us"(w)
        stylelang: "en"(s) "en-us"(w)
        fullnamelang: "en"(s) "en-us"(w)
        slant: 0(i)(s)
        weight: 200(i)(s)
        width: 100(i)(s)
        pixelsize: 32(f)(s)
        hintstyle: 3(i)(s)
        hinting: True(s)
        verticallayout: False(s)
        autohint: False(s)
        globaladvance: True(s)
        outline: True(s)
        lang: "en"(w) "en"(w)
        fontversion: 2147483647(i)(s)
        embeddedbitmap: True(s)
        decorative: False(s)
        lcdfilter: 1(i)(w) 1(i)(w)
        namelang: "en"(s)
        prgname: "wkhtmltopdf-amd64"(s)

Best score 0 0 0 0 0 0 1001 0 1 12 0 0 0 0 1 1 1 1 0 0 1 2.14748e+12
Pattern has 17 elts (size 17)
        family: "Nimbus Roman No9 L"(w)
        style: "Medium"(w)
        slant: 0(i)(w)
        weight: 200(i)(w)
        width: 100(i)(w)
        foundry: "urw"(w)
        file: "/usr/share/fonts/type1/gsfonts/n021004l.pfb"(w)
        index: 0(i)(w)
        outline: True(w)
        scalable: True(w)
        charset: 
        0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff 00040000 00000000 00000000 00000000
        0002: 0f000000 00000000 00000000 00000000 00000000 00000000 3f0002c0 00000000
        0003: 00000000 00000000 00000000 00000000 00100000 10000000 00000000 00000000
        0004: ffffffff ffffffff ffffffff 00000000 fffff000 ffffffff ffff199f 033fffff
        0020: 77180000 06010047 00000010 00000000 00000000 00001000 00000000 00000000
        0021: 00400000 00000004 00000000 00000000 00000000 00000000 00000000 00000000
        0022: 46260044 00000000 00000000 00000031 00000000 00000000 00000000 00000000
        0025: 00000000 00000000 00000000 00000000 00000000 00000000 00000400 00000000
        00f6: 00000000 00000000 00000000 00000000 00000000 00000000 000001f8 00000000
        00fb: 00000006 00000000 00000000 00000000 00000000 00000000 00000000 00000000
(w)
        lang: aa|ab|af|av|ay|ba|be|bg|bi|br|bs|bua|ca|ce|ch|chm|co|cs|cv|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu
|ia|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|kv|ky|la|lb|lez|lt|lv|mg|mh|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|
se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|zu|an|crh|csb|fil|hsb|ht|j
v|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(w)
        fontversion: 0(i)(w)
        fontformat: "Type 1"(w)
        decorative: False(w)
        hash: "sha256:372b66a5816f2c31323ef4b56166a6d89356bda6cc6276fa41532fc2f970807d"(w)
        postscriptname: "NimbusRomNo9L-Medi"(w)

Fontconfig output from the new app

Match Pattern has 22 elts (size 32)                          ] 50%
        family: "Helvetica"(s) "TeX Gyre Heros"(s) "Arial"(w) "Arimo"(w) "Liberation Sans"(w) "Albany"(w) "Albany AMT"(w) "Helvetica"(w) "Bitstream Vera Sans"(w) "DejaVu Sans"(w) "Verdana"(w) "Arial"(w) "Albany AMT"(w) "Luxi Sans"(w) "Nimbus Sans L"(w) "Nimbus Sans"(w) "Helvetica"(w) "Lucida Sans Unicode"(w) "BPG Glaho International"(w) "Tahoma"(w) "Nachlieli"(w) "Lucida Sans Unicode"(w) "Yudit Unicode"(w) "Kerkis"(w) "ArmNet Helvetica"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Waree"(w) "Loma"(w) "Garuda"(w) "Umpush"(w) "Saysettha Unicode"(w) "JG Lao Old Arial"(w) "GF Zemen Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narrow"(w) "malayalam"(w) "Sampige"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Gothic"(w) "UmePlus P Gothic"(w) "Microsoft YaHei"(w) "Microsoft JhengHei"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "MgOpen Modata"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "AR PL ShanHeiSun Uni"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "MS ゴシック"(w) "ZYSong18030"(w) "TSCu_Paranar"(w) "NanumGothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim"(w) "KacstQura"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSans"(w) "Arial Unicode MS"(w) "Arial Unicode"(w) "Code2000"(w) "Code2001"(w) "sans-serif"(w) "Roya"(w) "Koodak"(w) "Terafik"(w) "sans-serif"(w) "sans-serif"(w) "sans-serif"(w) "sans-serif"(w) "Helvetica"(w) "Helvetica"(w)
        familylang: "en"(s) "en-us"(w)
        stylelang: "en"(s) "en-us"(w)
        fullnamelang: "en"(s) "en-us"(w)
        slant: 0(i)(s)
        weight: 200(i)(s)
        width: 100(i)(s)
        size: 30.72(f)(s)
        pixelsize: 32(f)(s)
        hintstyle: 1(i)(w)
        hinting: True(s)
        verticallayout: False(s)
        autohint: False(s)
        globaladvance: True(s)
        outline: True(s)
        lang: "en"(w)
        fontversion: 2147483647(i)(s)
        embeddedbitmap: True(s)
        decorative: False(s)
        namelang: "en"(s)
        prgname: "wkhtmltopdf"(s)
        symbol: False(s)

Best score 0 0 0 0 0 0 1000 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 2.14748e+12
Pattern has 19 elts (size 19)
        family: "Nimbus Sans L"(w)
        style: "Bold"(w)
        stylelang: "en"(w) "en"(w)
        slant: 0(i)(w)
        weight: 200(i)(w)
        width: 100(i)(w)
        foundry: "urw"(w)
        file: "/usr/share/fonts/Type1/n019004l.pfb"(w)
        index: 0(i)(w)
        outline: True(w)
        scalable: True(w)
        charset: 
        0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff 00040000 00000000 00000000 00000000
        0002: 0f000000 00000000 00000000 00000000 00000000 00000000 3f0002c0 00000000
        0003: 00000000 00000000 00000000 00000000 00100000 10000000 00000000 00000000
        0004: ffffffff ffffffff ffffffff 00000000 fffff000 ffffffff ffff199f 033fffff
        0020: 77180000 06010047 00000010 00000000 00000000 00001000 00000000 00000000
        0021: 00000000 00000004 00000000 00000000 00000000 00000000 00000000 00000000
        0022: 06260044 00000000 00000000 00000031 00000000 00000000 00000000 00000000
        0025: 00000000 00000000 00000000 00000000 00000000 00000000 00000400 00000000
        00f6: 00000000 00000000 00000000 00000000 00000000 00000000 00000008 00000000
        00fb: 00000006 00000000 00000000 00000000 00000000 00000000 00000000 00000000
(w)
        lang: aa|ab|af|av|ay|ba|be|bg|bi|br|bs|bua|ca|ce|ch|chm|co|cs|cv|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|kv|ky|la|lb|lez|lt|lv|mg|mh|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(w)
        fontversion: 0(i)(w)
        fontformat: "Type 1"(w)
        decorative: False(w)
        postscriptname: "NimbusSanL-Bold"(w)
        color: False(w)
        symbol: False(w)

Release update for alpine:3.16

Hi! I've been running this flawlessly on version 3.15, however I'm now attempting to update my builder image to 3.16 (as a result of updating other dependencies) and doing so introduces errors on container start. From my tests and searching around, this is due to differences in alpine versions.

Would it be possible to release an update in order to support alpine 3.16? Thank you!

Relevant SO post with the exact error + suggested resolution: https://stackoverflow.com/questions/72609505/issue-with-building-elixir-and-beam-on-alpine-linux

How can I use this inside my dockerfile

Hi,

I'm building a PHP app and I want to use wkhtmltopdf on alpine. Could, I just copy Dockerfile_3.9-0.12.5-small to my dockerfile or are there better alternatives. Thanks

Symbols not found: alpine-wkhtmltopdf with PHP-FPM 8.2

Hey, I am encountering problems with using alpine-wkhtmltopdf in PHP 8.2 and was hoping for some tipps here.

Environment

# dockerfile
FROM php:8.2-fpm-alpine AS base

[...]

COPY --from=surnet/alpine-wkhtmltopdf:3.10-0.12.5-full /bin/wkhtmltopdf /usr/bin/wkhtmltopdf
COPY --from=surnet/alpine-wkhtmltopdf:3.10-0.12.5-full /bin/wkhtmltoimage /usr/bin/wkhtmltoimage
COPY --from=surnet/alpine-wkhtmltopdf:3.10-0.12.5-full /bin/libwkhtmltox* /usr/bin/

Expected behaviour

I should be able to use the binaries to generate an image from html

Actual behaviour

Following errors get thrown

Handling &quot;App\Messenger\Model\AssetProcessor\GeneratePdf&quot; failed: The exit status code '127' says something went wrong:
stderr: &quot;Error loading shared library libssl.so.1.1: No such file or directory (needed by /usr/bin/wkhtmltoimage)
Error loading shared library libcrypto.so.1.1: No such file or directory (needed by /usr/bin/wkhtmltoimage)
Error relocating /usr/bin/wkhtmltoimage: EVP_PKEY_base_id: symbol not found
Error relocating /usr/bin/wkhtmltoimage: EVP_PKEY_id: symbol not found
Error relocating /usr/bin/wkhtmltoimage: SSL_get_peer_certificate: symbol not found

I could fix this by symlinking libcrypto.so.1.1 and libssl.so.1.1 to the respective current libX.so in /usr/lib
But I am still getting the last three errors

How to reproduce

Run /usr/bin/wkhtmltoimage --format 'jpg' --width '595' '/tmp/95887354.html' '/tmp/kpJICJ' in above env while having /tmp/95887354.html in place

Document the use of libssl3 for other images based on alpine3.19 in readme

hey there, first, thanks for the docker image, it helped me a lot to build some great stuff ❤️ 😄

since #43 the build uses libssl3 on alpine3.19 since libssl1.1 isn't available anymore. There should probably be a note about that in the readme to tell users of alpine versions above 3.19 to use libssl3 no (talking about the Other images section) ?

Alpine 3.19

Hi,

I tried to use your repository to build a wkhtmltopdf binary for alpine 3.19 (released on 2023-12-07) and had to make some changes to get it working with the now dropped libssl1.1 package which was replaced with a libssl3 one:

master...klausmeyer:docker-wkhtmltopdf:feat/alpine-3.19

Should I create a PR or would you like to address it on your own / in a different way?

Best, Klaus

Absence of page options

Hello,

I'm using your image surnet/alpine-wkhtmltopdf:3.13.5-0.12.6-full in Alpine image in order to use a QT patched version of wkhtmltopdf

It works well, however, the page options and tons of other options are missing (e.g.: footer-html is missing).
Is it normal?
Is there a way to get these options?

Thank you a lot

The Dockerfile of my image:

FROM surnet/alpine-wkhtmltopdf:3.13.5-0.12.6-full as wkhtmltopdf
FROM alpine:3.13

# Install APT packages
RUN apk --no-cache add \
...
   ttf-dejavu ttf-droid ttf-freefont ttf-liberation \
   libstdc++ \
   libx11 \
   libxrender \
   libxext \
   libssl1.1 \
   ca-certificates \
   fontconfig \
   freetype

   COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/libwkhtmltox.so /bin/

The doc got from wkhtmltopdf -h

Name:
  wkhtmltopdf 0.12.6 (with patched qt)

Synopsis:
  wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>
  
Document objects:
  wkhtmltopdf is able to put several objects into the output file, an object is
  either a single webpage, a cover webpage or a table of contents.  The objects
  are put into the output document in the order they are specified on the
  command line, options can be specified on a per object basis or in the global
  options area. Options from the Global Options section can only be placed in
  the global options area.

  A page objects puts the content of a single webpage into the output document.

  (page)? <input url/file name> [PAGE OPTION]...
  Options for the page object can be placed in the global options and the page
  options areas. The applicable options can be found in the Page Options and 
  Headers And Footer Options sections.

  A cover objects puts the content of a single webpage into the output document,
  the page does not appear in the table of contents, and does not have headers
  and footers.

  cover <input url/file name> [PAGE OPTION]...
  All options that can be specified for a page object can also be specified for
  a cover.

  A table of contents object inserts a table of contents into the output
  document.

  toc [TOC OPTION]...
  All options that can be specified for a page object can also be specified for
  a toc, further more the options from the TOC Options section can also be
  applied. The table of contents is generated via XSLT which means that it can
  be styled to look however you want it to look. To get an idea of how to do
  this you can dump the default xslt document by supplying the
  --dump-default-toc-xsl, and the outline it works on by supplying
  --dump-outline, see the Outline Options section.

Description:
  Converts one or more HTML pages into a PDF document, using wkhtmltopdf patched
  qt.

Global Options:
      --collate                       Collate when printing multiple copies
                                      (default)
      --no-collate                    Do not collate when printing multiple
                                      copies
      --copies <number>               Number of copies to print into the pdf
                                      file (default 1)
  -H, --extended-help                 Display more extensive help, detailing
                                      less common command switches
  -g, --grayscale                     PDF will be generated in grayscale
  -h, --help                          Display help
      --license                       Output license information and exit
      --log-level <level>             Set log level to: none, error, warn or
                                      info (default info)
  -l, --lowquality                    Generates lower quality pdf/ps. Useful to
                                      shrink the result document space
  -O, --orientation <orientation>     Set orientation to Landscape or Portrait
                                      (default Portrait)
  -s, --page-size <Size>              Set paper size to: A4, Letter, etc.
                                      (default A4)
  -q, --quiet                         Be less verbose, maintained for backwards
                                      compatibility; Same as using --log-level
                                      none
      --read-args-from-stdin          Read command line arguments from stdin
      --title <text>                  The title of the generated pdf file (The
                                      title of the first document is used if not
                                      specified)
  -V, --version                       Output version information and exit

Page Options:
      --print-media-type              Use print media-type instead of screen
      --no-print-media-type           Do not use print media-type instead of
                                      screen (default)

Contact:
  If you experience bugs or want to request new features please visit 
  <https://wkhtmltopdf.org/support.html>

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.