Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
sudo apt install autotools-dev autopoint cmake libtool pkg-config libcups2-dev libexif-dev liblcms2-dev libfontconfig1-dev
sudo apt install libfreetype6-dev build-essential qtbase5-dev qtchooser libcairo2-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libopenjp2-7-dev liblcms2-dev libjpeg-dev
sudo apt install -y libjxl-dev
- name: Install pdfio >= 1.6.0
- name: Install pdfio >= 1.6.2
run: |
cd ..
mkdir pdfio
wget https://github.com/michaelrsweet/pdfio/releases/download/v1.6.0/pdfio-1.6.0.tar.gz
tar -xzf pdfio-1.6.0.tar.gz
cd pdfio-1.6.0
wget https://github.com/michaelrsweet/pdfio/releases/download/v1.6.2/pdfio-1.6.2.tar.gz
tar -xzf pdfio-1.6.2.tar.gz
cd pdfio-1.6.2
./configure --prefix=/usr --enable-shared
make all
make test
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ AS_IF([test x"$with_fontconfig" != "xno" && test "x$enable_texttopdf" != "xno"],
AC_DEFINE([HAVE_FONTCONFIG], [1], [Defines if we are using fontconfig.])
PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.0.0])
])
PKG_CHECK_MODULES([LIBPDFIO], [pdfio >= 1.6.0])
PKG_CHECK_MODULES([LIBPDFIO], [pdfio >= 1.6.2])


# =================
Expand Down
2 changes: 1 addition & 1 deletion cupsfilters/pdftopdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2467,7 +2467,7 @@ prepare_documents(
}
}

if (p.has_form || p.has_annotations)
if (p.has_form && p.has_annotations)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not really understand this change. For me it looks wrong, as we need flattening when there is a form and we need also flattening when there are annotations. We do not only need flattening when there is BOTH a form AND annotations.

Did you also test whether the filter behaves correctly with a PDF which ONLY contains a (filled) form or ONLY contains annotations? Does filled in text or annotations get printed?

Why does this change make the images in the test file being shown?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the files in the testing suite, and they have passed.
But I will test through more files as you have told, specifically with the pdf which only contains a (filled) form or only annotations.

Yes, this change does make the images in the test files being shown.

{
if ((flattened_pdf = pdfioFileCreateTemporary(flattened_pdf_file, sizeof(flattened_pdf_file), "1.7", &p.media, &p.media, pdfio_error_cb, &p)) == NULL)
return (false);
Expand Down
Binary file modified cupsfilters/test_files/form_english.pdf
Binary file not shown.