OpenPrinting / cups-filters

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
151 stars 123 forks source link

pdftopdf scaling regression in 1.28.x and 2.0.0 #549

Open 10ne1 opened 9 months ago

10ne1 commented 9 months ago

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:

10ne1 commented 8 months ago

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

tillkamppeter commented 6 months ago

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

10ne1 commented 6 months ago

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

arunpatwa commented 3 months ago

@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

10ne1 commented 3 months ago

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...

arunpatwa commented 3 months ago

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

10ne1 commented 3 months ago

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:

tillkamppeter commented 3 weeks ago

This one should be fixed in libcupsfilters 2.x (and so also in cups-filters 2.x) by the merge of PR #56. Should be easy to backport to 1.x.