OpenPrinting / libppd

Apache License 2.0
2 stars 13 forks source link

ppd-filter.c: Generate media-col if media-col-default exists #15

Closed zdohnal closed 1 year ago

zdohnal commented 1 year ago

We would generate media-col attribute only if we had media-col-default attribute and PageSize or media options, which doesn't seem to be always the case for PageSize and media. These options usually are not default options and if the application doesn't send them, they are not sent to filters.

The current implementation breaks image printing for (at least) printers installed with Postscript driver - the printer outputs an empty sheet of paper. It happens because cfFilterImageToPDF() doesn't get page size by other means.

zdohnal commented 1 year ago

@tillkamppeter ping

tillkamppeter commented 1 year ago

We must be careful here. If no "PageSize" or "media" option is supplied to a job, many filters (especially for PDF and PostScript) assume the input page size for each page of the job (which can change throughout the job), so we have to check whether adding a copy of media-col-default as media-col could defeat this, making these filter assuming that the user specified a page size. What we actually have to do is to try harder to find the default page size of the printer. If we have media-col-default we should actually use the default size described there, independent whether there is a media-col job attribute set or not.

tillkamppeter commented 1 year ago

Solved https://github.com/OpenPrinting/libcupsfilters/issues/26 in libcupsfilters. The bug also occurs when no PPD file is given (broken output instead of fallback to US Letter).

Solved via: https://github.com/OpenPrinting/libcupsfilters/commit/5238c6ef69acb

But thanks anyway for the bug report and the investigations.