-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ppd-cache.c: Use PPD size name from CUPS if size is standardized #30
Conversation
Previously, if there were two sizes with the same size, but different names in PPD, the second was ignored during generating sizes for PPD cache. This behavior breaks already broken PPDs, which provide two or more different size names for the same width and length (which is incorrect), and if the ignored size was the PPD default (such as A4), user couldn't print a test page. After this fix, we use PPD size name from CUPS if the size is standarized. Fixes OpenPrinting#29
This part of |
Generally your change is OK, and it works at least if the default page size name is a standard one. It does not work if
|
I'm experiencing the same problem. [This is Envelope YOUGATANAGA 3] The two papers are printed well with cups-filter-1.x. Can this PR fix this problem? @zdohnal |
I think it is not incorrect. |
I'm sorry, I don't have time atm to work to incorporate changes which Till mentioned. If you would like to have it fixed sooner, feel free to take the PR and implement the changes Till mentioned.
IMHO different opening orientation is not reflected in invocations of PageSize keyword options - PageSize covers length and width of paper, not where the text or opening gap is. |
Let's restate this: IPP's media size naming standard requires that sheet sizes (and that includes envelopes since they are fed like sheets) be represented using their portrait dimensions - the feed orientation is a separate attribute since the printer's paper path might pull media from any edge and that pull edge might even be (and often is) different based on the tray used. Thus, two envelopes with the same physical dimensions use the SAME media size name but might report two different media feed orientations. From the standpoint of a PPD file, there is no way to differentiate between the media sizes. And if you had an IPP printer with both types of envelope loaded, you can expect the wrong things to happen... WRT your example, how is the content cut off on the other envelope size? Is it a rotation issue (i.e. the envelope is fed in the landscape orientation but the content is printed portrait) or is the output correctly oriented but cut off? |
It is not a rotation issue; it is an issue caused by the libcupsfilter2.x. Print both page size well by using the libcupsfilter1.x |
Further investigation result:
So the bug can be fixed by updating the macro |
@szlt5 if you know it is the correct fix, feel free to file a PR and Till will review it once he gets a chance. But IMHO widening the error range could bring more side effects than fixing matching of similar page size... by wdyt, @tillkamppeter ? @tillkamppeter can you give us some fake PPD examples of the cases you mentioned we should cover? Tbh I had difficulty to imagine what you mean, and since I had other pressing matters, then I had difficulty to return back to it. I hope once we see the PPD code examples of what you mean, it would be easier to implement it. |
The current epsilon value in the CUPS sources is 50 (equivalent to 0.5mm) which is what we should be using. Smaller values will only cause problems, and the half-millimeter tolerance is what we recommend at the PWG. Honestly most media sensors, if available, are only accurate to 1mm and the manufacturing tolerances for paper are similarly in the .Nmm range. |
@szlt5 @michaelrsweet ok, I have created PR for change of delta and I tested it against the original problem, and unfortunately it did not fix it - so what @szlt5 found was another issue. The original still needs fixing. |
Closing this due #46 . |
Previously, if there were two sizes with the same size, but different names in PPD, the second was ignored during generating sizes for PPD cache. This behavior breaks already broken PPDs, which provide two or more different size names for the same width and length (which is incorrect), and if the ignored size was the PPD default (such as A4), user couldn't print a test page.
After this fix, we use PPD size name from CUPS if the size is standarized.
Fixes #29