-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
page.FooterRight.Set("[page]") from example not working #76
Comments
Your code is correct. The Bytes() will not be the issue, that just returns the buffer. I created a test with your code on https://github.com/SebastiaanKlippert/go-wkhtmltopdf/blob/issue/76/wkhtmltopdf_test.go#L257 On both Windows and Ubuntu this works as intended. You can download the artifacts at https://github.com/SebastiaanKlippert/go-wkhtmltopdf/suites/4538274705/artifacts/121644975 Can you share your result? I could run a Github action in Debian buster if you want, but since the Go code is correct any difference in OS will probably not be in my code but rather wkhtmltopdf itself. |
Hey @SebastiaanKlippert , |
No, it should work as shown in the test I created above. |
Linux (fedora) |
@SebastiaanKlippert related issue there as well #50 |
In the related issue the original reporter only said "Ok thank you. Its working" without providing any more details. So that means that in wkhtmltopdf this works Then the only workaround is to use the code I provided in the related issue, but then you would have to write the HTML input files to disk first. It does not look like something I can solve in the Go wrapper as it is an issue in wkhtmltopdf itself (wkhtmltopdf/wkhtmltopdf#3014) |
FWIW, I also ran into this issue this morning. The culprit on my end was that I was running on wkhtmltopdf |
Also having the same issue and i'm using the latest wkhtmltopdf 0.12.6 with the current code
|
It seems to be working when wkhtmltopdf 0.12.6 with patched Qt is installed, which is not the one installed using apt. @SebastiaanKlippert Is the patched version mandatory ? Edit: Got my answer using
|
Issue: Qt Patch Requirement for wkhtmltopdf Version@RomainGsd ContextThe latest version of Version
Steps to Install Dependencies and wkhtmltox
Docker Image TemplateTo simplify the setup process, you can use the following Docker image template: # Use the official golang image as the base image for building
FROM golang:1.22.1-bookworm AS builder
# Set the maintainer label
LABEL maintainer="NaserKh <KHALIFA.MohamedNaceur@esprit.tn>"
# Set the working directory inside the container
WORKDIR /go/src/app
# Copy the entire current directory into the container's working directory
COPY . .
# Enable Go modules
ENV GO111MODULE=on
# Install Git, Go dependencies, and additional required packages
RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
go mod tidy && \
go mod download
# Install necessary dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
fontconfig \
fontconfig-config \
fonts-dejavu-core \
libbsd0 \
libfontconfig1 \
libfontenc1 \
libfreetype6 \
libjpeg62-turbo \
libmd0 \
libpng16-16 \
libx11-6 \
libx11-data \
libxau6 \
libxcb1 \
libxdmcp6 \
libxext6 \
libxrender1 \
sensible-utils \
ucf \
x11-common \
xfonts-75dpi \
xfonts-base \
xfonts-encodings \
xfonts-utils && \
rm -rf /var/lib/apt/lists/*
# Download and install wkhtmltox for Bookworm
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb && \
dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb && \
apt-get install -f -y && \
rm wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
# Create a non-root user and home directory
RUN groupadd -r foulen && useradd -r -g foulen -d /home/foulen foulen && mkdir -p /home/foulen && chown -R foulen:foulen /home/foulen
# Set the working directory
WORKDIR /app
# Expose any necessary ports (if applicable)
EXPOSE 8080
# Switch to non-root user
USER foulen
# Start the application
CMD ["/bin/bash", "-c", "while true; do sleep 1; done"] This Dockerfile ensures that all necessary dependencies for |
Hiya, following your example I can't seem to get a footer or header in...
OS: "Debian GNU/Linux 10 (buster)"
"My" code:
Any idea or tips of what I'm doing wrong here? Is it the
.Bytes()
?The text was updated successfully, but these errors were encountered: