Re: [Printing-architecture] names of paper sizes
Michael Sweet <[email protected]> Wed, 17 May 2023 06:52:34 -0400
| Newsgroups | dev.linux.lists.printing-architecture |
|---|---|
| Message-ID | <[email protected]> |
Mignon, > On May 14, 2023, at 6:04 PM, Mignon Pelletier <[email protected]> wrote: > > I'm confused about the many names that a paper size can have. > > If I query my DYMO LabelWriter 450 Turbo with code like this: > > ipp_attribute_t *media = > cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, > CUPS_MEDIA); > int i, count = ippGetCount(media); > > puts("media supported:"); > for (i = 0; i < count; i ++) > printf(" %s\n", ippGetString(media, i, NULL)); > > Then I get names like this: > > custom_54.19x22.27mm_54.19x22.27mm > custom_25.4x54.02mm_25.4x54.02mm > custom_1x1in_1x1in > custom_2.25x1.25in_2.25x1.25in > custom_0.75x2in_0.75x2in > custom_41.32x88.9mm_41.32x88.9mm > > However, if I run "lpoptions -p LabelWriter-450-Turbo -l", I get names like this: > > PageSize/Media Size: w154h64 w72h154 w72h72 w162h90 w54h144 w118h252 > w167h188 w79h252 w167h252 *w167h288 w154h198 w82h248 w154h64.1 > w79h252.1 w102h252 w154h286 w154h198.1 w54h424 w131h221 w57h248 Correct. The names you get via IPP are PWG self-describing media size names, while the names reported by lpoptions are the Adobe PPD media size names (a much older "standard"). Both are accepted by the current version of CUPS but going forward only PWG media size names will work. > ... > 1) Where are the names reported by cupsFindDestSupported() coming from? From cupsd, which converts the PPD names to PWG names. Localization information is placed in a separate .strings file for the queue that can be queried by the application. > 2) How can I obtain the human-readable names, such as "30330 Return Address", preferably without using any deprecated APIs? The cupsLocalizeDestMedia function is provided for this since CUPS 2.0. ________________________ Michael Sweet
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkIbDzcZsP1Y8+PQFvmfHXsgfMkQFAmRksfIACgkQvmfHXsgf MkSW+xAAp60Sxrz6jlqcMcS/efu+oHmc8rbFHddeCIy28Hoh7OgRfTepEOOt2VTF zAHxHt8hxA0gtEgARdVv0HMUnpjKoKTfpY+E7dAr9GM0dKduanHb4rl7jPr9BPFm BBZdzkgd3bNQfC3yZdBsdSkVzbVCFBxxUQ/2kMvixdCLkz69JTUQENkkdP8P0rvi mnw5gJaDOk7H0YseCgj3HpwU0u0QnyFFyBLrtfIvBRQ6G2pygUnnyPCsaERbStof L79fRbBitOuhJ49FXHxKOuuuWbGPVWVFn8m94HIlr2OyCJGOBSLswx0IoOWhnkSd vV3AL1yLNmTNbj7VESzBzgHf1rL1qahEyNNgghv3h8wpBwY9dP73pbHfDOogvodZ W/unYPW+NYVAMKzN4I5mDl0VbjPEiimuU4lke/BQ7O7t5Gn60IM04oSLNiwsG6Tl jfmBJPiD/Ve8jRMVzVqjIOa7djXB2nxFoA8nYSpSVRSrUJ7gJXMdtxkwOnckA6Mz f7tLi9TBe3Xb4KBdZGNWflYIsRlG2llfNLGGywPh106JB7FB1Uwd3QmbWXkmS5NE JsDoBarg9U78JJXOegfH4P8pLwcno2Kezcq5ccPHF/zsc+Qsj/oLCRhWB2ok/Qrm WICnLg9QWZjKJqY8STav1FCq76gWZUdZqL7FDPwT/5jg02Dw7PM= =YzL2 -----END PGP SIGNATURE-----