I have a problem with this function flatten_pdf, I am trying to flatten a pdf after filling it, I tried with the parameter flatten of the function write_fillable_pdf, but it gives me error when the pdf contains fillable checkbox, then I decided to try with the function flatten_pdf, the result was almost as I expected, the detail was that it flattened the text fields but not the checkbox, so they were still fillable, after that I decided to try with the as_images parameter of the flatten_pdf function, it worked perfectly, but when I wanted to deploy it in Docker, when testing it no longer works, the filled text fields are not there, but the checkboxes are marked, in other words it works halfway.
My Dockerfile
FROM python:3.9.12-slim-bullseye
RUN apt-get update && apt-get install -y poppler-utils
RUN mkdir -p /app/src
RUN mkdir -p /app/src/logs
COPY ./requirements.txt /app
RUN pip install --no-cache-dir -r /app/requirements.txt
Hello,
I have a problem with this function flatten_pdf, I am trying to flatten a pdf after filling it, I tried with the parameter flatten of the function write_fillable_pdf, but it gives me error when the pdf contains fillable checkbox, then I decided to try with the function flatten_pdf, the result was almost as I expected, the detail was that it flattened the text fields but not the checkbox, so they were still fillable, after that I decided to try with the as_images parameter of the flatten_pdf function, it worked perfectly, but when I wanted to deploy it in Docker, when testing it no longer works, the filled text fields are not there, but the checkboxes are marked, in other words it works halfway.
My Dockerfile
FROM python:3.9.12-slim-bullseye
RUN apt-get update && apt-get install -y poppler-utils
RUN mkdir -p /app/src
RUN mkdir -p /app/src/logs
COPY ./requirements.txt /app
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY ./src /app/src
EXPOSE 8000
WORKDIR /app
CMD [“python”, “./src/main.py”]
Would you like help me ?