cups-filters icon indicating copy to clipboard operation
cups-filters copied to clipboard

pdftopdf scaling regression in 1.28.x and 2.0.0

Open 10ne1 opened this issue 10 months ago • 8 comments

Hello

Describe the bug This example doc used to print fine until cups-filters v1.28.11, but starting with v1.28.12 the output document is mangled. Looks like a scaling issue.

If I checkout v1.28.12 and revert the following commits introduced by 1.28.12, the document output is correct again, so one or maybe a combination of them is causing the regression, likely the two scaling commits:

ddd9da98fd8 pdftopdf: Add 2% tolerance for input size larger than output page
02e95494b49 pdftopdf: Set a default for "print-scaling"
207314fc3db pdftopdf: Fixed print-scaling and N-up for asymmetric margins and files with differently-sized pages

I have also reproduced this with the latest v2.0.0, this is why I think it is likely a real bug, not just a backporting problem on 1.28.12 - 1.28.17.

To Reproduce

Run the following command on the document linked above and compare the output

/usr/lib/cups/filter/pdftopdf 1 1 1 1 "" Example_1-page1-5.pdf > output.pdf

Expected behavior The output should display the same as the input file, which used to happen in previous versions as described above., however the text is now very small in the bottom left corner.

System Information:

  • OS: Arch Linux x86_64 and ChromeOS aarch64
  • Browser: Chrome 119, Firefox 117

10ne1 avatar Sep 27 '23 10:09 10ne1

Gentle ping: is this a known issues for both v2.0.x and v1.28.x releases? Thanks

10ne1 avatar Nov 01 '23 05:11 10ne1

Hi, could you repost or attach example.doc? Or at least allow access to it? Thanks.

tillkamppeter avatar Dec 12 '23 18:12 tillkamppeter

@tillkamppeter Here you go. I messed up the file sharing permissions, sorry, you should have access now.

10ne1 avatar Dec 13 '23 14:12 10ne1

@10ne1 Hi, I have build the cups-filter and reproduced the output.pdf which is mangling. I am facing issue when I checkout to 1.28.12 and reverting to the commit "ddd9da98fd8" and then on running "./configure" and "sudo make" , There are lots of dependencies errors. this is occuring when I checkout from master to 1.28.12 . some of the errors I have solved by checking the changes.. but still there are errors. How I can solve the errors while reverting the commits...

image

arunpatwa avatar Mar 24 '24 10:03 arunpatwa

Hey @arunpatwa it's been quite a while, but IIRC I had to revert all 3 commits which I pointed to, not just the first.

I really hope this gets a proper fix...

10ne1 avatar Mar 24 '24 12:03 10ne1

Thanks for your active response @10ne1. This time , I have reverted all 3 commits. and then did "./autogen.sh", "./configure" and "make" . I am still getting errors. I am trying to fix these since 3-4 days but unfortunately did not find the way... errors are occurring when in cups-filter , I switch from "master" branch to "1.28.12" there are lots of files/structure changes which are causing issue in building again.

Could you please try this on your device ? Is it also giving similar types of errors or I am facing this issue. It would be really helpful, so that can work on logical part of issue , instead of debugging errors.

I wanted to see , how after reverting these commits , I will get correct output.

Thank You

arunpatwa avatar Mar 24 '24 19:03 arunpatwa

Hi @arunpatwa thanks for looking into it.

I created the following branch with the 3 commits reverted on top of v1.28.12: https://github.com/10ne1/cups-filters/tree/dev/aratiu/pdf-scaling-regression1.28.12-revert

The only conflicts I got were on the NEWS file which are expected and can be ignored so I dropped them.

I ran autogen.sh, then

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=aarch64-cros-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/cups-filters-1.28.7-r6 --htmldir=/usr/share/doc/cups-filters-1.28.7-r6/html --with-sysroot=/build/jacuzzi --libdir=/usr/lib64 --docdir=/usr/share/doc/cups-filters-1.28.7-r6 --disable-avahi

then make -j16 and it built just fine

Edit: I am cross-compiling for arm64, so this exact build I did will not run on x86_64 obviously. Please adjust the configure command for your own machine :smile:

10ne1 avatar Mar 28 '24 13:03 10ne1