Skip to content

Commit

Permalink
Merge pull request #103 from OpenPrinting/pclm
Browse files Browse the repository at this point in the history
Add PCLm support to libcups
  • Loading branch information
michaelrsweet authored Feb 21, 2025
2 parents 02953f4 + 4a816c6 commit 177ead8
Show file tree
Hide file tree
Showing 6 changed files with 354 additions and 51 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ libcups v3.0rc4 (YYYY-MM-DD)
`--client-name` options.
- Updated `cupsOAuthGetMetadata` to support Microsoft Azure/Entra OAuth
servers.
- Updated `ipptransform` to support generation of PCLm output in addition to PWG
Raster data.
- Fixed handling of finishings/finishings-col and media/media-col in the
`ippeveprinter` tool (Issue #95)
- Fixed a duplicate printer reporting bug in `cupsGetDests`.
Expand Down
21 changes: 18 additions & 3 deletions doc/ipptransform.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h2 id="ipptransform-1.options">Options</h2>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-m</strong><em> OUTPUT/FORMAT</em>
<br>
Specifies the MIME media type of the output file.
Currently the &quot;application/pdf&quot; (PDF), &quot;application/postscript&quot; (PostScript), &quot;application/vnd.hp-pcl&quot; (HP PCL), &quot;image/pwg-raster&quot; (PWG Raster), and &quot;image/urf&quot; (Apple Raster) MIME media types are supported.
Currently the &quot;application/PCLm&quot; (PCLm), &quot;application/pdf&quot; (PDF), &quot;application/postscript&quot; (PostScript), &quot;application/vnd.hp-pcl&quot; (HP PCL), &quot;image/pwg-raster&quot; (PWG Raster), and &quot;image/urf&quot; (Apple Raster) MIME media types are supported.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o</strong><em> &quot;NAME=VALUE</em><strong>[...</strong><em>NAME=VALUE]&quot;</em>
<br>
Expand Down Expand Up @@ -327,17 +327,32 @@ <h2 id="ipptransform-1.environment">Environment</h2>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_xxx_DEFAULT</strong><br>
Specifies the default value of the corresponding &quot;xxx-default&quot; Printer Description attribute, where &quot;xxx&quot; is converted to uppercase.
For example, the &quot;media-default&quot; Printer Description attribute is stored as the &quot;IPP_MEDIA_DEFAULT&quot; environment variable.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PCLM_RASTER_BACK_SIDE</strong><br>
Specifies the coordinate system of the back side of duplex sheets.
The default is 'normal'.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PCLM_SOURCE_RESOLUTION_SUPPORTED</strong><br>
Lists the supported output resolutions.
The default is 600dpi.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PCLM_STRIP_HEIGHT_PREFERRED</strong><br>
Specifies the preferred strip height for the printer.
The default is 16.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PWG_RASTER_DOCUMENT_RESOLUTION_SUPPORTED</strong><br>
Lists the supported output resolutions.
The default is 300dpi.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PWG_RASTER_DOCUMENT_SHEET_BACK</strong><br>
Specifies the coordinate system of the back side of duplex sheets.
The default is 'normal'.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PWG_RASTER_DOCUMENT_TYPE_SUPPORTED</strong><br>
Lists the supported output color spaces and bit depths.
The default is 'sgray_8'.
</p>
<p style="margin-left: 2.5em; text-indent: -2.5em;">IPPTRANSFORM_MAX_RASTER<br>
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPPTRANSFORM_MAX_RASTER</strong><br>
Specifies the maximum number of bytes to use when generating raster data.
The default is 16MB.
</p>
Expand Down Expand Up @@ -371,7 +386,7 @@ <h2 id="ipptransform-1.see-also">See Also</h2>

</p>
<h2 id="ipptransform-1.copyright">Copyright</h2>
<p>Copyright &copy; 2023 by OpenPrinting.
<p>Copyright &copy; 2023-2025 by OpenPrinting.
Copyright &copy; 2016-2019 by the Printer Working Group.
Copyright &copy; 2016-2019 by Apple Inc.
</body>
Expand Down
25 changes: 20 additions & 5 deletions man/ipptransform.1
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.\"
.\" ipptransform man page.
.\"
.\" Copyright © 2023 by OpenPrinting.
.\" Copyright © 2023-2025 by OpenPrinting.
.\" Copyright © 2016-2019 by the Printer Working Group.
.\" Copyright © 2016-2019 by Apple Inc.
.\"
.\" Licensed under Apache License v2.0. See the file "LICENSE" for more
.\" information.
.\"
.TH ipptransform 1 "ippsample" "2023-11-22" "OpenPrinting"
.TH ipptransform 1 "ippsample" "2025-02-21" "OpenPrinting"
.SH NAME
ipptransform \- convert document data to alternate formats
.br
Expand Down Expand Up @@ -72,7 +72,7 @@ Currently the "application/pdf" (PDF) and "image/jpeg" (JPEG) MIME media types a
.TP 5
.BI \-m \ OUTPUT/FORMAT
Specifies the MIME media type of the output file.
Currently the "application/pdf" (PDF), "application/postscript" (PostScript), "application/vnd.hp-pcl" (HP PCL), "image/pwg-raster" (PWG Raster), and "image/urf" (Apple Raster) MIME media types are supported.
Currently the "application/PCLm" (PCLm), "application/pdf" (PDF), "application/postscript" (PostScript), "application/vnd.hp-pcl" (HP PCL), "image/pwg-raster" (PWG Raster), and "image/urf" (Apple Raster) MIME media types are supported.
.TP 5
.BI \-o \ "NAME=VALUE [... NAME=VALUE]"
Specifies one or more named options for the conversion.
Expand Down Expand Up @@ -227,16 +227,31 @@ For example, the "media" Job Template attribute is stored as the "IPP_MEDIA" env
Specifies the default value of the corresponding "xxx-default" Printer Description attribute, where "xxx" is converted to uppercase.
For example, the "media-default" Printer Description attribute is stored as the "IPP_MEDIA_DEFAULT" environment variable.
.TP 5
.B IPP_PCLM_RASTER_BACK_SIDE
Specifies the coordinate system of the back side of duplex sheets.
The default is 'normal'.
.TP 5
.B IPP_PCLM_SOURCE_RESOLUTION_SUPPORTED
Lists the supported output resolutions.
The default is 600dpi.
.TP 5
.B IPP_PCLM_STRIP_HEIGHT_PREFERRED
Specifies the preferred strip height for the printer.
The default is 16.
.TP 5
.B IPP_PWG_RASTER_DOCUMENT_RESOLUTION_SUPPORTED
Lists the supported output resolutions.
The default is 300dpi.
.TP 5
.B IPP_PWG_RASTER_DOCUMENT_SHEET_BACK
Specifies the coordinate system of the back side of duplex sheets.
The default is 'normal'.
.TP 5
.B IPP_PWG_RASTER_DOCUMENT_TYPE_SUPPORTED
Lists the supported output color spaces and bit depths.
The default is 'sgray_8'.
.TP 5
IPPTRANSFORM_MAX_RASTER
.B IPPTRANSFORM_MAX_RASTER
Specifies the maximum number of bytes to use when generating raster data.
The default is 16MB.
.TP 5
Expand Down Expand Up @@ -269,6 +284,6 @@ Convert a JPEG file to sRGB PWG Raster at 600dpi:
.SH SEE ALSO
.BR ipptool (1),
.SH COPYRIGHT
Copyright \[co] 2023 by OpenPrinting.
Copyright \[co] 2023-2025 by OpenPrinting.
Copyright \[co] 2016-2019 by the Printer Working Group.
Copyright \[co] 2016-2019 by Apple Inc.
2 changes: 1 addition & 1 deletion pdfio
Submodule pdfio updated 112 files
9 changes: 5 additions & 4 deletions tools/ippeveprinter.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// IPP Everywhere printer application for CUPS.
//
// Copyright © 2021-2024 by OpenPrinting.
// Copyright © 2021-2025 by OpenPrinting.
// Copyright © 2020 by the IEEE-ISTO Printer Working Group.
// Copyright © 2010-2021 by Apple Inc.
//
Expand Down Expand Up @@ -5466,14 +5466,15 @@ process_job(ippeve_job_t *job) // I - Job

for (attr = ippGetFirstAttribute(job->printer->attrs); attr && myenvc < (int)(sizeof(myenvp) / sizeof(myenvp[0]) - 1); attr = ippGetNextAttribute(job->printer->attrs))
{
// Convert "attribute-name-default" to "IPP_ATTRIBUTE_NAME_DEFAULT=" and
// "pwg-xxx" to "IPP_PWG_XXX", then add the value(s) from the attribute.
// Convert "attribute-name-default" to "IPP_ATTRIBUTE_NAME_DEFAULT=",
// "pclm-xxx" to "IPP_PCLM_XXX", and "pwg-xxx" to "IPP_PWG_XXX", then add
// the value(s) from the attribute.
const char *name = ippGetName(attr),
// Attribute name
*suffix = strstr(name, "-default");
// Suffix on attribute name

if (strncmp(name, "pwg-", 4) && (!suffix || suffix[8]))
if (strncmp(name, "pclm-", 5) && strncmp(name, "pwg-", 4) && strcmp(name, "urf-supported") && (!suffix || suffix[8]))
continue;

valptr = val;
Expand Down
Loading

0 comments on commit 177ead8

Please sign in to comment.