mirror of https://gitee.com/openkylin/cups.git
1991 lines
85 KiB
HTML
1991 lines
85 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-US">
|
||
<!-- SECTION: Programming -->
|
||
<head>
|
||
<title>PPD API (DEPRECATED)</title>
|
||
<meta name="keywords" content="Programming">
|
||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||
<meta name="generator" content="codedoc v3.7">
|
||
<meta name="author" content="Unknown">
|
||
<meta name="language" content="en-US">
|
||
<meta name="copyright" content="Unknown">
|
||
<meta name="version" content="0.0">
|
||
<style type="text/css"><!--
|
||
body {
|
||
background: white;
|
||
color: black;
|
||
font-family: sans-serif;
|
||
font-size: 12pt;
|
||
}
|
||
a {
|
||
color: black;
|
||
}
|
||
a:link, a:visited {
|
||
color: #00f;
|
||
}
|
||
a:link:hover, a:visited:hover, a:active {
|
||
color: #c0c;
|
||
}
|
||
body, p, h1, h2, h3, h4, h5, h6 {
|
||
font-family: sans-serif;
|
||
line-height: 1.4;
|
||
}
|
||
h1, h2, h3, h4, h5, h6 {
|
||
font-weight: bold;
|
||
page-break-inside: avoid;
|
||
}
|
||
h1 {
|
||
font-size: 250%;
|
||
margin: 0;
|
||
}
|
||
h2 {
|
||
font-size: 250%;
|
||
margin-top: 1.5em;
|
||
}
|
||
h3 {
|
||
font-size: 200%;
|
||
margin-bottom: 0.5em;
|
||
margin-top: 1.5em;
|
||
}
|
||
h4 {
|
||
font-size: 150%;
|
||
margin-bottom: 0.5em;
|
||
margin-top: 1.5em;
|
||
}
|
||
h5 {
|
||
font-size: 125%;
|
||
margin-bottom: 0.5em;
|
||
margin-top: 1.5em;
|
||
}
|
||
h6 {
|
||
font-size: 110%;
|
||
margin-bottom: 0.5em;
|
||
margin-top: 1.5em;
|
||
}
|
||
img.title {
|
||
width: 256px;
|
||
}
|
||
div.header h1, div.header p {
|
||
text-align: center;
|
||
}
|
||
div.contents, div.body, div.footer {
|
||
page-break-before: always;
|
||
}
|
||
.class, .enumeration, .function, .struct, .typedef, .union {
|
||
border-bottom: solid 2px gray;
|
||
}
|
||
.description {
|
||
margin-top: 0.5em;
|
||
}
|
||
.function {
|
||
margin-bottom: 0;
|
||
}
|
||
blockquote {
|
||
border: solid thin gray;
|
||
box-shadow: 3px 3px 5px rgba(127,127,127,0.25);
|
||
margin: 1em 0;
|
||
padding: 10px;
|
||
page-break-inside: avoid;
|
||
}
|
||
p code, li code, p.code, pre, ul.code li {
|
||
font-family: monospace;
|
||
hyphens: manual;
|
||
-webkit-hyphens: manual;
|
||
}
|
||
p.code, pre, ul.code li {
|
||
background: rgba(127,127,127,0.25);
|
||
border: thin dotted gray;
|
||
padding: 10px;
|
||
page-break-inside: avoid;
|
||
}
|
||
pre {
|
||
white-space: pre-wrap;
|
||
}
|
||
a:link, a:visited {
|
||
text-decoration: none;
|
||
}
|
||
span.info {
|
||
background: black;
|
||
border: solid thin black;
|
||
color: white;
|
||
font-size: 80%;
|
||
font-style: italic;
|
||
font-weight: bold;
|
||
white-space: nowrap;
|
||
}
|
||
h1 span.info, h2 span.info, h3 span.info, h4 span.info {
|
||
border-top-left-radius: 10px;
|
||
border-top-right-radius: 10px;
|
||
float: right;
|
||
padding: 3px 6px;
|
||
}
|
||
ul.code, ul.contents, ul.subcontents {
|
||
list-style-type: none;
|
||
margin: 0;
|
||
padding-left: 0;
|
||
}
|
||
ul.code li {
|
||
margin: 0;
|
||
}
|
||
ul.contents > li {
|
||
margin-top: 1em;
|
||
}
|
||
ul.contents li ul.code, ul.contents li ul.subcontents {
|
||
padding-left: 2em;
|
||
}
|
||
table {
|
||
border-collapse: collapse;
|
||
border-spacing: 0;
|
||
}
|
||
td {
|
||
border: solid 1px gray;
|
||
padding: 5px 10px;
|
||
vertical-align: top;
|
||
}
|
||
td.left {
|
||
text-align: left;
|
||
}
|
||
td.center {
|
||
text-align: center;
|
||
}
|
||
td.right {
|
||
text-align: right;
|
||
}
|
||
th {
|
||
border-bottom: solid 2px gray;
|
||
padding: 1px 5px;
|
||
text-align: center;
|
||
vertical-align: bottom;
|
||
}
|
||
tr:nth-child(even) {
|
||
background: rgba(127,127,127,0.25);
|
||
}
|
||
table.list {
|
||
border-collapse: collapse;
|
||
width: 100%;
|
||
}
|
||
table.list th {
|
||
border-bottom: none;
|
||
border-right: 2px solid gray;
|
||
font-family: monospace;
|
||
font-weight: normal;
|
||
padding: 5px 10px 5px 2px;
|
||
text-align: right;
|
||
vertical-align: top;
|
||
}
|
||
table.list td {
|
||
border: none;
|
||
padding: 5px 2px 5px 10px;
|
||
text-align: left;
|
||
vertical-align: top;
|
||
}
|
||
h2.title, h3.title {
|
||
border-bottom: solid 2px gray;
|
||
}
|
||
/* Syntax highlighting */
|
||
span.comment {
|
||
color: darkgreen;
|
||
}
|
||
span.directive {
|
||
color: purple;
|
||
}
|
||
span.number {
|
||
color: brown;
|
||
}
|
||
span.reserved {
|
||
color: darkcyan;
|
||
}
|
||
span.string {
|
||
color: magenta;
|
||
}
|
||
/* Dark mode overrides */
|
||
@media (prefers-color-scheme: dark) {
|
||
body {
|
||
background: black;
|
||
color: #ccc;
|
||
}
|
||
a {
|
||
color: #ccc;
|
||
}
|
||
a:link, a:visited {
|
||
color: #66f;
|
||
}
|
||
a:link:hover, a:visited:hover, a:active {
|
||
color: #f06;
|
||
}
|
||
}
|
||
/* Show contents on left side in web browser */
|
||
@media screen and (min-width: 800px) {
|
||
div.contents {
|
||
border-right: solid thin gray;
|
||
bottom: 0px;
|
||
box-shadow: 3px 3px 5px rgba(127,127,127,0.5);
|
||
font-size: 10pt;
|
||
left: 0px;
|
||
overflow: scroll;
|
||
padding: 1%;
|
||
position: fixed;
|
||
top: 0px;
|
||
width: 18%;
|
||
}
|
||
div.contents h2.title {
|
||
margin-top: 0px;
|
||
}
|
||
div.header, div.body, div.footer {
|
||
margin-left: 20%;
|
||
padding: 1% 2%;
|
||
}
|
||
}
|
||
/* Center title page content vertically */
|
||
@media print {
|
||
div.header {
|
||
padding-top: 33%;
|
||
}
|
||
}
|
||
--></style>
|
||
</head>
|
||
<body>
|
||
<div class="header">
|
||
<!--
|
||
PPD API header for CUPS.
|
||
|
||
Copyright © 2008-2019 by Apple Inc.
|
||
|
||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||
information.
|
||
-->
|
||
|
||
<h1 class='title'>PPD API (DEPRECATED)</h1>
|
||
|
||
<blockquote><b>Note:</b>
|
||
|
||
<p>The PPD API was deprecated in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS Programming Manual</a> documentation. These functions will be removed in a future release of CUPS.</p>
|
||
</blockquote>
|
||
|
||
<div class='summary'><table summary='General Information'>
|
||
<thead>
|
||
<tr>
|
||
<th>Header</th>
|
||
<th>cups/ppd.h</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<th>Library</th>
|
||
<td>-lcups</td>
|
||
</tr>
|
||
<tr>
|
||
<th>See Also</th>
|
||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
|
||
Programming: <a href='cupspm.html' target='_top'>CUPS Programming Manual</a><br>
|
||
Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="contents">
|
||
<h2 class="title">Contents</h2>
|
||
<ul class="contents">
|
||
<li><a href="#OVERVIEW">Overview</a><ul class="subcontents">
|
||
<li><a href="#LOADING">Loading a PPD File</a></li>
|
||
<li><a href="#OPTIONS_AND_GROUPS">Options and Groups</a></li>
|
||
<li><a href="#CONSTRAINTS">Constraints</a></li>
|
||
<li><a href="#PAGE_SIZES">Page Sizes</a></li>
|
||
<li><a href="#ATTRIBUTES">Attributes</a></li>
|
||
</ul></li>
|
||
<li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
|
||
<li><a href="#cupsGetConflicts">cupsGetConflicts</a></li>
|
||
<li><a href="#cupsGetPPD">cupsGetPPD</a></li>
|
||
<li><a href="#cupsGetPPD2">cupsGetPPD2</a></li>
|
||
<li><a href="#cupsGetPPD3">cupsGetPPD3</a></li>
|
||
<li><a href="#cupsGetServerPPD">cupsGetServerPPD</a></li>
|
||
<li><a href="#cupsMarkOptions">cupsMarkOptions</a></li>
|
||
<li><a href="#cupsRasterInterpretPPD">cupsRasterInterpretPPD</a></li>
|
||
<li><a href="#cupsResolveConflicts">cupsResolveConflicts</a></li>
|
||
<li><a href="#ppdCollect">ppdCollect</a></li>
|
||
<li><a href="#ppdCollect2">ppdCollect2</a></li>
|
||
<li><a href="#ppdConflicts">ppdConflicts</a></li>
|
||
<li><a href="#ppdEmit">ppdEmit</a></li>
|
||
<li><a href="#ppdEmitAfterOrder">ppdEmitAfterOrder</a></li>
|
||
<li><a href="#ppdEmitFd">ppdEmitFd</a></li>
|
||
<li><a href="#ppdEmitJCL">ppdEmitJCL</a></li>
|
||
<li><a href="#ppdEmitJCLEnd">ppdEmitJCLEnd</a></li>
|
||
<li><a href="#ppdEmitString">ppdEmitString</a></li>
|
||
<li><a href="#ppdFindAttr">ppdFindAttr</a></li>
|
||
<li><a href="#ppdFindChoice">ppdFindChoice</a></li>
|
||
<li><a href="#ppdFindCustomOption">ppdFindCustomOption</a></li>
|
||
<li><a href="#ppdFindCustomParam">ppdFindCustomParam</a></li>
|
||
<li><a href="#ppdFindMarkedChoice">ppdFindMarkedChoice</a></li>
|
||
<li><a href="#ppdFindNextAttr">ppdFindNextAttr</a></li>
|
||
<li><a href="#ppdFindOption">ppdFindOption</a></li>
|
||
<li><a href="#ppdFirstCustomParam">ppdFirstCustomParam</a></li>
|
||
<li><a href="#ppdFirstOption">ppdFirstOption</a></li>
|
||
<li><a href="#ppdInstallableConflict">ppdInstallableConflict</a></li>
|
||
<li><a href="#ppdIsMarked">ppdIsMarked</a></li>
|
||
<li><a href="#ppdLocalize">ppdLocalize</a></li>
|
||
<li><a href="#ppdLocalizeAttr">ppdLocalizeAttr</a></li>
|
||
<li><a href="#ppdLocalizeIPPReason">ppdLocalizeIPPReason</a></li>
|
||
<li><a href="#ppdLocalizeMarkerName">ppdLocalizeMarkerName</a></li>
|
||
<li><a href="#ppdMarkDefaults">ppdMarkDefaults</a></li>
|
||
<li><a href="#ppdMarkOption">ppdMarkOption</a></li>
|
||
<li><a href="#ppdNextCustomParam">ppdNextCustomParam</a></li>
|
||
<li><a href="#ppdNextOption">ppdNextOption</a></li>
|
||
<li><a href="#ppdPageLength">ppdPageLength</a></li>
|
||
<li><a href="#ppdPageSize">ppdPageSize</a></li>
|
||
<li><a href="#ppdPageSizeLimits">ppdPageSizeLimits</a></li>
|
||
<li><a href="#ppdPageWidth">ppdPageWidth</a></li>
|
||
</ul></li>
|
||
<li><a href="#TYPES">Data Types</a><ul class="subcontents">
|
||
<li><a href="#cups_interpret_cb_t">cups_interpret_cb_t</a></li>
|
||
<li><a href="#ppd_attr_t">ppd_attr_t</a></li>
|
||
<li><a href="#ppd_choice_t">ppd_choice_t</a></li>
|
||
<li><a href="#ppd_conform_t">ppd_conform_t</a></li>
|
||
<li><a href="#ppd_const_t">ppd_const_t</a></li>
|
||
<li><a href="#ppd_coption_t">ppd_coption_t</a></li>
|
||
<li><a href="#ppd_cparam_t">ppd_cparam_t</a></li>
|
||
<li><a href="#ppd_cplimit_t">ppd_cplimit_t</a></li>
|
||
<li><a href="#ppd_cptype_t">ppd_cptype_t</a></li>
|
||
<li><a href="#ppd_cpvalue_t">ppd_cpvalue_t</a></li>
|
||
<li><a href="#ppd_cs_t">ppd_cs_t</a></li>
|
||
<li><a href="#ppd_emul_t">ppd_emul_t</a></li>
|
||
<li><a href="#ppd_file_t">ppd_file_t</a></li>
|
||
<li><a href="#ppd_group_t">ppd_group_t</a></li>
|
||
<li><a href="#ppd_option_t">ppd_option_t</a></li>
|
||
<li><a href="#ppd_profile_t">ppd_profile_t</a></li>
|
||
<li><a href="#ppd_section_t">ppd_section_t</a></li>
|
||
<li><a href="#ppd_size_t">ppd_size_t</a></li>
|
||
<li><a href="#ppd_status_t">ppd_status_t</a></li>
|
||
<li><a href="#ppd_ui_t">ppd_ui_t</a></li>
|
||
</ul></li>
|
||
<li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
|
||
<li><a href="#ppd_attr_s">ppd_attr_s</a></li>
|
||
<li><a href="#ppd_choice_s">ppd_choice_s</a></li>
|
||
<li><a href="#ppd_const_s">ppd_const_s</a></li>
|
||
<li><a href="#ppd_coption_s">ppd_coption_s</a></li>
|
||
<li><a href="#ppd_cparam_s">ppd_cparam_s</a></li>
|
||
<li><a href="#ppd_emul_s">ppd_emul_s</a></li>
|
||
<li><a href="#ppd_file_s">ppd_file_s</a></li>
|
||
<li><a href="#ppd_group_s">ppd_group_s</a></li>
|
||
<li><a href="#ppd_option_s">ppd_option_s</a></li>
|
||
<li><a href="#ppd_profile_s">ppd_profile_s</a></li>
|
||
<li><a href="#ppd_size_s">ppd_size_s</a></li>
|
||
</ul></li>
|
||
<li><a href="#UNIONS">Unions</a><ul class="subcontents">
|
||
<li><a href="#ppd_cplimit_u">ppd_cplimit_u</a></li>
|
||
<li><a href="#ppd_cpvalue_u">ppd_cpvalue_u</a></li>
|
||
</ul></li>
|
||
<li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
|
||
<li><a href="#ppd_conform_e">ppd_conform_e</a></li>
|
||
<li><a href="#ppd_cptype_e">ppd_cptype_e</a></li>
|
||
<li><a href="#ppd_cs_e">ppd_cs_e</a></li>
|
||
<li><a href="#ppd_section_e">ppd_section_e</a></li>
|
||
<li><a href="#ppd_status_e">ppd_status_e</a></li>
|
||
<li><a href="#ppd_ui_e">ppd_ui_e</a></li>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div class="body">
|
||
<!--
|
||
PPD API introduction for CUPS.
|
||
|
||
Copyright © 2007-2019 by Apple Inc.
|
||
Copyright © 1997-2006 by Easy Software Products, all rights reserved.
|
||
|
||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||
information.
|
||
-->
|
||
|
||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||
|
||
<blockquote><b>Note:</b>
|
||
|
||
<p>The PPD API was deprecated in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS Programming Manual</a> documentation. These functions will be removed in a future release of CUPS.</p>
|
||
</blockquote>
|
||
|
||
<p>The CUPS PPD API provides read-only access the data in PostScript Printer
|
||
Description ("PPD") files which are used for all printers with a driver. With
|
||
it you can obtain the data necessary to display printer options to users, mark
|
||
option choices and check for conflicting choices, and output marked choices in
|
||
PostScript output. The <a href="#ppd_file_t"><code>ppd_file_t</code></a>
|
||
structure contains all of the information in a PPD file.</p>
|
||
|
||
<blockquote><b>Note:</b>
|
||
|
||
<p>The CUPS PPD API uses the terms "option" and "choice" instead of the Adobe
|
||
terms "MainKeyword" and "OptionKeyword" to refer to specific printer options and
|
||
features. CUPS also treats option ("MainKeyword") and choice ("OptionKeyword")
|
||
values as case-insensitive strings, so option "InputSlot" and choice "Upper"
|
||
are equivalent to "inputslot" and "upper", respectively.</p>
|
||
</blockquote>
|
||
|
||
|
||
<h3><a name="LOADING">Loading a PPD File</a></h3>
|
||
|
||
<p>The <a href="#ppdOpenFile"><code>ppdOpenFile</code></a> function "opens" a
|
||
PPD file and loads it into memory. For example, the following code opens the
|
||
current printer's PPD file in a CUPS filter:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd = <a href="#ppdOpenFile">ppdOpenFile</a>(getenv("PPD"));
|
||
</pre>
|
||
|
||
<p>The return value is a pointer to a new
|
||
<a href="#ppd_file_t"><code>ppd_file_t</code></a> structure or <code>NULL</code>
|
||
if the PPD file does not exist or cannot be loaded. The
|
||
<a href="#ppdClose"><code>ppdClose</code></a> function frees the memory used
|
||
by the structure:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd;
|
||
|
||
<a href="#ppdClose">ppdClose</a>(ppd);
|
||
</pre>
|
||
|
||
<p>Once closed, pointers to the <a href="#ppd_file_t"><code>ppd_file_t</code></a>
|
||
structure and any data in it will no longer be valid.</p>
|
||
|
||
<h3><a name="OPTIONS_AND_GROUPS">Options and Groups</a></h3>
|
||
|
||
<p>PPD files support multiple options, which are stored in arrays of
|
||
<a href="#ppd_option_t"><code>ppd_option_t</code></a> and
|
||
<a href="#ppd_choice_t"><code>ppd_choice_t</code></a> structures.</p>
|
||
|
||
<p>Each option in turn is associated with a group stored in a
|
||
<a href="#ppd_group_t"><code>ppd_group_t</code></a> structure. Groups can be
|
||
specified in the PPD file; if an option is not associated with a group
|
||
then it is put in an automatically-generated "General" group. Groups can also
|
||
have sub-groups, however CUPS currently ignores sub-groups because of past
|
||
abuses of this functionality.</p>
|
||
|
||
<p>Option choices are selected by marking them using one of three functions. The
|
||
first is <a href="#ppdMarkDefaults"><code>ppdMarkDefaults</code></a> which
|
||
selects all of the default options in the PPD file:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd;
|
||
|
||
<a href="#ppdMarkDefaults">ppdMarkDefaults</a>(ppd);
|
||
</pre>
|
||
|
||
<p>The second is <a href="#ppdMarkOption"><code>ppdMarkOption</code></a>
|
||
which selects a single option choice in the PPD file. For example, the following
|
||
code selects the upper paper tray:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd;
|
||
|
||
<a href="#ppdMarkOption">ppdMarkOption</a>(ppd, "InputSlot", "Upper");
|
||
</pre>
|
||
|
||
<p>The last function is
|
||
<a href="#cupsMarkOptions"><code>cupsMarkOptions</code></a> which selects
|
||
multiple option choices in the PPD file from an array of CUPS options, mapping
|
||
IPP attributes like "media" and "sides" to their corresponding PPD options. You
|
||
typically use this function in a print filter with
|
||
<code>cupsParseOptions</code> and
|
||
<a href="#ppdMarkDefaults"><code>ppdMarkDefaults</code></a> to select all of
|
||
the option choices needed for the job, for example:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd = <a href="#ppdOpenFile">ppdOpenFile</a>(getenv("PPD"));
|
||
cups_option_t *options = NULL;
|
||
int num_options = cupsParseOptions(argv[5], 0, &options);
|
||
|
||
<a href="#ppdMarkDefaults">ppdMarkDefaults</a>(ppd);
|
||
<a href="#cupsMarkOptions">cupsMarkOptions</a>(ppd, num_options, options);
|
||
cupsFreeOptions(num_options, options);
|
||
</pre>
|
||
|
||
|
||
<h3><a name="CONSTRAINTS">Constraints</a></h3>
|
||
|
||
<p>PPD files support specification of conflict conditions, called
|
||
constraints, between different options. Constraints are stored in an array of
|
||
<a href="#ppd_const_t"><code>ppd_const_t</code></a> structures which specify
|
||
the options and choices that conflict with each other. The
|
||
<a href="#ppdConflicts"><code>ppdConflicts</code></a> function tells you
|
||
how many of the selected options are incompatible. Since constraints are
|
||
normally specified in pairs, the returned value is typically an even number.</p>
|
||
|
||
|
||
<h3><a name="PAGE_SIZES">Page Sizes</a></h3>
|
||
|
||
<p>Page sizes are special options which have physical dimensions and margins
|
||
associated with them. The size information is stored in
|
||
<a href="#ppd_size_t"><code>ppd_size_t</code></a> structures and is available
|
||
by looking up the named size with the
|
||
<a href="#ppdPageSize"><code>ppdPageSize</code></a> function. The page size and
|
||
margins are returned in units called points; there are 72 points per inch. If
|
||
you pass <code>NULL</code> for the size, the currently selected size is
|
||
returned:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd;
|
||
<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, NULL);
|
||
</pre>
|
||
|
||
<p>Besides the standard page sizes listed in a PPD file, some printers
|
||
support variable or custom page sizes. Custom page sizes are supported if the
|
||
<code>variables_sizes</code> member of the
|
||
<a href="#ppd_file_t"><code>ppd_file_t</code></a> structure is non-zero.
|
||
The <code>custom_min</code>, <code>custom_max</code>, and
|
||
<code>custom_margins</code> members of the
|
||
<a href="#ppd_file_t"><code>ppd_file_t</code></a> structure define the limits
|
||
of the printable area. To get the resulting media size, use a page size string
|
||
of the form "Custom.<I>width</I>x<I>length</I>", where "width" and "length" are
|
||
in points. Custom page size names can also be specified in inches
|
||
("Custom.<i>width</i>x<i>height</i>in"), centimeters
|
||
("Custom.<i>width</i>x<i>height</i>cm"), or millimeters
|
||
("Custom.<i>width</i>x<i>height</i>mm"):</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd;
|
||
|
||
/* Get an 576x720 point custom page size */
|
||
<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.576x720");
|
||
|
||
/* Get an 8x10 inch custom page size */
|
||
<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.8x10in");
|
||
|
||
/* Get a 100x200 millimeter custom page size */
|
||
<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.100x200mm");
|
||
|
||
/* Get a 12.7x34.5 centimeter custom page size */
|
||
<a href="#ppd_size_t">ppd_size_t</a> *size = <a href="#ppdPageSize">ppdPageSize</a>(ppd, "Custom.12.7x34.5cm");
|
||
</pre>
|
||
|
||
<p>If the PPD does not support variable page sizes, the
|
||
<a href="#ppdPageSize"><code>ppdPageSize</code></a> function will return
|
||
<code>NULL</code>.</p>
|
||
|
||
|
||
<h3><a name="ATTRIBUTES">Attributes</a></h3>
|
||
|
||
<p>Every PPD file is composed of one or more attributes. Most of these
|
||
attributes are used to define groups, options, choices, and page sizes,
|
||
however several informational attributes may be present which you can access
|
||
in your program or filter. Attributes normally look like one of the following
|
||
examples in a PPD file:</p>
|
||
|
||
<pre class="example">
|
||
*name: "value"
|
||
*name spec: "value"
|
||
*name spec/text: "value"
|
||
</pre>
|
||
|
||
<p>The <a href="#ppdFindAttr"><code>ppdFindAttr</code></a> and
|
||
<a href="#ppdFindNextAttr"><code>ppdFindNextAttr</code></a> functions find the
|
||
first and next instances, respectively, of the named attribute with the given
|
||
"spec" string and return a <a href="#ppd_attr_t"><code>ppd_attr_t</code></a>
|
||
structure. If you provide a NULL specifier string, all attributes with the
|
||
given name will be returned. For example, the following code lists all of the
|
||
<code>Product</code> attributes in a PPD file:</p>
|
||
|
||
<pre class="example">
|
||
#include <cups/ppd.h>
|
||
|
||
<a href="#ppd_file_t">ppd_file_t</a> *ppd;
|
||
<a href="#ppd_attr_t">ppd_attr_t</a> *attr;
|
||
|
||
for (attr = <a href="#ppdFindAttr">ppdFindAttr</a>(ppd, "Product", NULL);
|
||
attr != NULL;
|
||
attr = <a href="#ppdFindNextAttr">ppdFindNextAttr</a>(ppd, "Product", NULL))
|
||
puts(attr->value);
|
||
</pre>
|
||
<h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
|
||
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetConflicts">cupsGetConflicts</a></h3>
|
||
<p class="description">Get a list of conflicting options in a marked PPD.</p>
|
||
<p class="code">
|
||
int cupsGetConflicts(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option, const char *choice, cups_option_t **options);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Option to test</td></tr>
|
||
<tr><th>choice</th>
|
||
<td class="description">Choice to test</td></tr>
|
||
<tr><th>options</th>
|
||
<td class="description">Conflicting options</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Number of conflicting options</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function gets a list of options that would conflict if "option" and
|
||
"choice" were marked in the PPD. You would typically call this function
|
||
after marking the currently selected options in the PPD in order to
|
||
determine whether a new option selection would cause a conflict.<br>
|
||
<br>
|
||
The number of conflicting options are returned with "options" pointing to
|
||
the conflicting options. The returned option array must be freed using
|
||
<a href="#cupsFreeOptions"><code>cupsFreeOptions</code></a>.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="cupsGetPPD">cupsGetPPD</a></h3>
|
||
<p class="description">Get the PPD file for a printer on the default server.</p>
|
||
<p class="code">
|
||
const char *cupsGetPPD(const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>name</th>
|
||
<td class="description">Destination name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Filename for PPD file</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">For classes, <code>cupsGetPPD</code> returns the PPD file for the first printer
|
||
in the class.<br>
|
||
<br>
|
||
The returned filename is stored in a static buffer and is overwritten with
|
||
each call to <code>cupsGetPPD</code> or <a href="#cupsGetPPD2"><code>cupsGetPPD2</code></a>. The caller "owns" the
|
||
file that is created and must <code>unlink</code> the returned filename.</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetPPD2">cupsGetPPD2</a></h3>
|
||
<p class="description">Get the PPD file for a printer from the specified server.</p>
|
||
<p class="code">
|
||
const char *cupsGetPPD2(http_t *http, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>http</th>
|
||
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Destination name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Filename for PPD file</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">For classes, <code>cupsGetPPD2</code> returns the PPD file for the first printer
|
||
in the class.<br>
|
||
<br>
|
||
The returned filename is stored in a static buffer and is overwritten with
|
||
each call to <a href="#cupsGetPPD"><code>cupsGetPPD</code></a> or <code>cupsGetPPD2</code>. The caller "owns" the
|
||
file that is created and must <code>unlink</code> the returned filename.
|
||
|
||
</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetPPD3">cupsGetPPD3</a></h3>
|
||
<p class="description">Get the PPD file for a printer on the specified
|
||
server if it has changed.</p>
|
||
<p class="code">
|
||
http_status_t cupsGetPPD3(http_t *http, const char *name, time_t *modtime, char *buffer, size_t bufsize);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>http</th>
|
||
<td class="description">HTTP connection or <code>CUPS_HTTP_DEFAULT</code></td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Destination name</td></tr>
|
||
<tr><th>modtime</th>
|
||
<td class="description">Modification time</td></tr>
|
||
<tr><th>buffer</th>
|
||
<td class="description">Filename buffer</td></tr>
|
||
<tr><th>bufsize</th>
|
||
<td class="description">Size of filename buffer</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">HTTP status</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">The "modtime" parameter contains the modification time of any
|
||
locally-cached content and is updated with the time from the PPD file on
|
||
the server.<br>
|
||
<br>
|
||
The "buffer" parameter contains the local PPD filename. If it contains
|
||
the empty string, a new temporary file is created, otherwise the existing
|
||
file will be overwritten as needed. The caller "owns" the file that is
|
||
created and must <code>unlink</code> the returned filename.<br>
|
||
<br>
|
||
On success, <code>HTTP_STATUS_OK</code> is returned for a new PPD file and
|
||
<code>HTTP_STATUS_NOT_MODIFIED</code> if the existing PPD file is up-to-date. Any other
|
||
status is an error.<br>
|
||
<br>
|
||
For classes, <code>cupsGetPPD3</code> returns the PPD file for the first printer
|
||
in the class.
|
||
|
||
</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsGetServerPPD">cupsGetServerPPD</a></h3>
|
||
<p class="description">Get an available PPD file from the server.</p>
|
||
<p class="code">
|
||
char *cupsGetServerPPD(http_t *http, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>http</th>
|
||
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Name of PPD file ("ppd-name")</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Name of PPD file or <code>NULL</code> on error</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function returns the named PPD file from the server. The
|
||
list of available PPDs is provided by the IPP <code>CUPS_GET_PPDS</code>
|
||
operation.<br>
|
||
<br>
|
||
You must remove (unlink) the PPD file when you are finished with
|
||
it. The PPD filename is stored in a static location that will be
|
||
overwritten on the next call to <a href="#cupsGetPPD"><code>cupsGetPPD</code></a>, <a href="#cupsGetPPD2"><code>cupsGetPPD2</code></a>,
|
||
or <a href="#cupsGetServerPPD"><code>cupsGetServerPPD</code></a>.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="cupsMarkOptions">cupsMarkOptions</a></h3>
|
||
<p class="description">Mark command-line options in a PPD file.</p>
|
||
<p class="code">
|
||
int cupsMarkOptions(<a href="#ppd_file_t">ppd_file_t</a> *ppd, int num_options, cups_option_t *options);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>num_options</th>
|
||
<td class="description">Number of options</td></tr>
|
||
<tr><th>options</th>
|
||
<td class="description">Options</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">1 if conflicts exist, 0 otherwise</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function maps the IPP "finishings", "media", "mirror",
|
||
"multiple-document-handling", "output-bin", "print-color-mode",
|
||
"print-quality", "printer-resolution", and "sides" attributes to their
|
||
corresponding PPD options and choices.</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRasterInterpretPPD">cupsRasterInterpretPPD</a></h3>
|
||
<p class="description">Interpret PPD commands to create a page header.</p>
|
||
<p class="code">
|
||
int cupsRasterInterpretPPD(cups_page_header2_t *h, <a href="#ppd_file_t">ppd_file_t</a> *ppd, int num_options, cups_option_t *options, <a href="#cups_interpret_cb_t">cups_interpret_cb_t</a> func);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>h</th>
|
||
<td class="description">Page header to create</td></tr>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>num_options</th>
|
||
<td class="description">Number of options</td></tr>
|
||
<tr><th>options</th>
|
||
<td class="description">Options</td></tr>
|
||
<tr><th>func</th>
|
||
<td class="description">Optional page header callback (<code>NULL</code> for none)</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on failure</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function is used by raster image processing (RIP) filters like
|
||
cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
|
||
It is not used by raster printer driver filters which only read CUPS
|
||
raster data.<br>
|
||
<br>
|
||
|
||
<code>cupsRasterInterpretPPD</code> does not mark the options in the PPD using
|
||
the "num_options" and "options" arguments. Instead, mark the options with
|
||
<code>cupsMarkOptions</code> and <code>ppdMarkOption</code> prior to calling it -
|
||
this allows for per-page options without manipulating the options array.<br>
|
||
<br>
|
||
The "func" argument specifies an optional callback function that is
|
||
called prior to the computation of the final raster data. The function
|
||
can make changes to the <a href="#cups_page_header2_t"><code>cups_page_header2_t</code></a> data as needed to use a
|
||
supported raster format and then returns 0 on success and -1 if the
|
||
requested attributes cannot be supported.<br>
|
||
<br>
|
||
|
||
<code>cupsRasterInterpretPPD</code> supports a subset of the PostScript language.
|
||
Currently only the <code>[</code>, <code>]</code>, <code><<</code>, <code>>></code>, <code>{</code>,
|
||
<code>}</code>, <code>cleartomark</code>, <code>copy</code>, <code>dup</code>, <code>index</code>,
|
||
<code>pop</code>, <code>roll</code>, <code>setpagedevice</code>, and <code>stopped</code> operators
|
||
are supported.
|
||
|
||
</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsResolveConflicts">cupsResolveConflicts</a></h3>
|
||
<p class="description">Resolve conflicts in a marked PPD.</p>
|
||
<p class="code">
|
||
int cupsResolveConflicts(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option, const char *choice, int *num_options, cups_option_t **options);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Newly selected option or <code>NULL</code> for none</td></tr>
|
||
<tr><th>choice</th>
|
||
<td class="description">Newly selected choice or <code>NULL</code> for none</td></tr>
|
||
<tr><th>num_options</th>
|
||
<td class="description">Number of additional selected options</td></tr>
|
||
<tr><th>options</th>
|
||
<td class="description">Additional selected options</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">1 on success, 0 on failure</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function attempts to resolve any conflicts in a marked PPD, returning
|
||
a list of option changes that are required to resolve them. On input,
|
||
"num_options" and "options" contain any pending option changes that have
|
||
not yet been marked, while "option" and "choice" contain the most recent
|
||
selection which may or may not be in "num_options" or "options".<br>
|
||
<br>
|
||
On successful return, "num_options" and "options" are updated to contain
|
||
"option" and "choice" along with any changes required to resolve conflicts
|
||
specified in the PPD file and 1 is returned.<br>
|
||
<br>
|
||
If option conflicts cannot be resolved, "num_options" and "options" are not
|
||
changed and 0 is returned.<br>
|
||
<br>
|
||
When resolving conflicts, <code>cupsResolveConflicts</code> does not consider
|
||
changes to the current page size (<code>media</code>, <code>PageSize</code>, and
|
||
<code>PageRegion</code>) or to the most recent option specified in "option".
|
||
Thus, if the only way to resolve a conflict is to change the page size
|
||
or the option the user most recently changed, <code>cupsResolveConflicts</code>
|
||
will return 0 to indicate it was unable to resolve the conflicts.<br>
|
||
<br>
|
||
The <code>cupsResolveConflicts</code> function uses one of two sources of option
|
||
constraint information. The preferred constraint information is defined by
|
||
<code>cupsUIConstraints</code> and <code>cupsUIResolver</code> attributes - in this
|
||
case, the PPD file provides constraint resolution actions.<br>
|
||
<br>
|
||
The backup constraint information is defined by the
|
||
<code>UIConstraints</code> and <code>NonUIConstraints</code> attributes. These
|
||
constraints are resolved algorithmically by first selecting the default
|
||
choice for the conflicting option, then iterating over all possible choices
|
||
until a non-conflicting option choice is found.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdCollect">ppdCollect</a></h3>
|
||
<p class="description">Collect all marked options that reside in the specified
|
||
section.</p>
|
||
<p class="code">
|
||
int ppdCollect(<a href="#ppd_file_t">ppd_file_t</a> *ppd, <a href="#ppd_section_t">ppd_section_t</a> section, <a href="#ppd_choice_t">ppd_choice_t</a> ***choices);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file data</td></tr>
|
||
<tr><th>section</th>
|
||
<td class="description">Section to collect</td></tr>
|
||
<tr><th>choices</th>
|
||
<td class="description">Pointers to choices</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Number of options marked</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">The choices array should be freed using <code>free</code> when you are
|
||
finished with it.</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdCollect2">ppdCollect2</a></h3>
|
||
<p class="description">Collect all marked options that reside in the
|
||
specified section and minimum order.</p>
|
||
<p class="code">
|
||
int ppdCollect2(<a href="#ppd_file_t">ppd_file_t</a> *ppd, <a href="#ppd_section_t">ppd_section_t</a> section, float min_order, <a href="#ppd_choice_t">ppd_choice_t</a> ***choices);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file data</td></tr>
|
||
<tr><th>section</th>
|
||
<td class="description">Section to collect</td></tr>
|
||
<tr><th>min_order</th>
|
||
<td class="description">Minimum OrderDependency value</td></tr>
|
||
<tr><th>choices</th>
|
||
<td class="description">Pointers to choices</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Number of options marked</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">The choices array should be freed using <code>free</code> when you are
|
||
finished with it.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdConflicts">ppdConflicts</a></h3>
|
||
<p class="description">Check to see if there are any conflicts among the
|
||
marked option choices.</p>
|
||
<p class="code">
|
||
int ppdConflicts(<a href="#ppd_file_t">ppd_file_t</a> *ppd);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD to check</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Number of conflicts found</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">The returned value is the same as returned by <a href="#ppdMarkOption"><code>ppdMarkOption</code></a>.</p>
|
||
<h3 class="function"><a id="ppdEmit">ppdEmit</a></h3>
|
||
<p class="description">Emit code for marked options to a file.</p>
|
||
<p class="code">
|
||
int ppdEmit(<a href="#ppd_file_t">ppd_file_t</a> *ppd, FILE *fp, <a href="#ppd_section_t">ppd_section_t</a> section);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>fp</th>
|
||
<td class="description">File to write to</td></tr>
|
||
<tr><th>section</th>
|
||
<td class="description">Section to write</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on failure</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdEmitAfterOrder">ppdEmitAfterOrder</a></h3>
|
||
<p class="description">Emit a subset of the code for marked options to a file.</p>
|
||
<p class="code">
|
||
int ppdEmitAfterOrder(<a href="#ppd_file_t">ppd_file_t</a> *ppd, FILE *fp, <a href="#ppd_section_t">ppd_section_t</a> section, int limit, float min_order);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>fp</th>
|
||
<td class="description">File to write to</td></tr>
|
||
<tr><th>section</th>
|
||
<td class="description">Section to write</td></tr>
|
||
<tr><th>limit</th>
|
||
<td class="description">Non-zero to use min_order</td></tr>
|
||
<tr><th>min_order</th>
|
||
<td class="description">Lowest OrderDependency</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on failure</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">When "limit" is non-zero, this function only emits options whose
|
||
OrderDependency value is greater than or equal to "min_order".<br>
|
||
<br>
|
||
When "limit" is zero, this function is identical to ppdEmit().
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdEmitFd">ppdEmitFd</a></h3>
|
||
<p class="description">Emit code for marked options to a file.</p>
|
||
<p class="code">
|
||
int ppdEmitFd(<a href="#ppd_file_t">ppd_file_t</a> *ppd, int fd, <a href="#ppd_section_t">ppd_section_t</a> section);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>fd</th>
|
||
<td class="description">File to write to</td></tr>
|
||
<tr><th>section</th>
|
||
<td class="description">Section to write</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on failure</p>
|
||
<h3 class="function"><a id="ppdEmitJCL">ppdEmitJCL</a></h3>
|
||
<p class="description">Emit code for JCL options to a file.</p>
|
||
<p class="code">
|
||
int ppdEmitJCL(<a href="#ppd_file_t">ppd_file_t</a> *ppd, FILE *fp, int job_id, const char *user, const char *title);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>fp</th>
|
||
<td class="description">File to write to</td></tr>
|
||
<tr><th>job_id</th>
|
||
<td class="description">Job ID</td></tr>
|
||
<tr><th>user</th>
|
||
<td class="description">Username</td></tr>
|
||
<tr><th>title</th>
|
||
<td class="description">Title</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on failure</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdEmitJCLEnd">ppdEmitJCLEnd</a></h3>
|
||
<p class="description">Emit JCLEnd code to a file.</p>
|
||
<p class="code">
|
||
int ppdEmitJCLEnd(<a href="#ppd_file_t">ppd_file_t</a> *ppd, FILE *fp);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>fp</th>
|
||
<td class="description">File to write to</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on failure</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdEmitString">ppdEmitString</a></h3>
|
||
<p class="description">Get a string containing the code for marked options.</p>
|
||
<p class="code">
|
||
char *ppdEmitString(<a href="#ppd_file_t">ppd_file_t</a> *ppd, <a href="#ppd_section_t">ppd_section_t</a> section, float min_order);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>section</th>
|
||
<td class="description">Section to write</td></tr>
|
||
<tr><th>min_order</th>
|
||
<td class="description">Lowest OrderDependency</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">String containing option code or <code>NULL</code> if there is no option code</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">When "min_order" is greater than zero, this function only includes options
|
||
whose OrderDependency value is greater than or equal to "min_order".
|
||
Otherwise, all options in the specified section are included in the
|
||
returned string.<br>
|
||
<br>
|
||
The return string is allocated on the heap and should be freed using
|
||
<code>free</code> when you are done with it.
|
||
|
||
</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ppdFindAttr">ppdFindAttr</a></h3>
|
||
<p class="description">Find the first matching attribute.</p>
|
||
<p class="code">
|
||
<a href="#ppd_attr_t">ppd_attr_t</a> *ppdFindAttr(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *name, const char *spec);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file data</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Attribute name</td></tr>
|
||
<tr><th>spec</th>
|
||
<td class="description">Specifier string or <code>NULL</code></td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Attribute or <code>NULL</code> if not found</p>
|
||
<h3 class="function"><a id="ppdFindChoice">ppdFindChoice</a></h3>
|
||
<p class="description">Return a pointer to an option choice.</p>
|
||
<p class="code">
|
||
<a href="#ppd_choice_t">ppd_choice_t</a> *ppdFindChoice(<a href="#ppd_option_t">ppd_option_t</a> *o, const char *choice);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>o</th>
|
||
<td class="description">Pointer to option</td></tr>
|
||
<tr><th>choice</th>
|
||
<td class="description">Name of choice</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Choice pointer or <code>NULL</code></p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdFindCustomOption">ppdFindCustomOption</a></h3>
|
||
<p class="description">Find a custom option.</p>
|
||
<p class="code">
|
||
<a href="#ppd_coption_t">ppd_coption_t</a> *ppdFindCustomOption(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *keyword);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>keyword</th>
|
||
<td class="description">Custom option name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Custom option or NULL</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdFindCustomParam">ppdFindCustomParam</a></h3>
|
||
<p class="description">Find a parameter for a custom option.</p>
|
||
<p class="code">
|
||
<a href="#ppd_cparam_t">ppd_cparam_t</a> *ppdFindCustomParam(<a href="#ppd_coption_t">ppd_coption_t</a> *opt, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>opt</th>
|
||
<td class="description">Custom option</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Parameter name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Custom parameter or NULL</p>
|
||
<h3 class="function"><a id="ppdFindMarkedChoice">ppdFindMarkedChoice</a></h3>
|
||
<p class="description">Return the marked choice for the specified option.</p>
|
||
<p class="code">
|
||
<a href="#ppd_choice_t">ppd_choice_t</a> *ppdFindMarkedChoice(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Keyword/option name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Pointer to choice or <code>NULL</code></p>
|
||
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ppdFindNextAttr">ppdFindNextAttr</a></h3>
|
||
<p class="description">Find the next matching attribute.</p>
|
||
<p class="code">
|
||
<a href="#ppd_attr_t">ppd_attr_t</a> *ppdFindNextAttr(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *name, const char *spec);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file data</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Attribute name</td></tr>
|
||
<tr><th>spec</th>
|
||
<td class="description">Specifier string or <code>NULL</code></td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Attribute or <code>NULL</code> if not found</p>
|
||
<h3 class="function"><a id="ppdFindOption">ppdFindOption</a></h3>
|
||
<p class="description">Return a pointer to the specified option.</p>
|
||
<p class="code">
|
||
<a href="#ppd_option_t">ppd_option_t</a> *ppdFindOption(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file data</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Option/Keyword name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Pointer to option or <code>NULL</code></p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdFirstCustomParam">ppdFirstCustomParam</a></h3>
|
||
<p class="description">Return the first parameter for a custom option.</p>
|
||
<p class="code">
|
||
<a href="#ppd_cparam_t">ppd_cparam_t</a> *ppdFirstCustomParam(<a href="#ppd_coption_t">ppd_coption_t</a> *opt);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>opt</th>
|
||
<td class="description">Custom option</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Custom parameter or NULL</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdFirstOption">ppdFirstOption</a></h3>
|
||
<p class="description">Return the first option in the PPD file.</p>
|
||
<p class="code">
|
||
<a href="#ppd_option_t">ppd_option_t</a> *ppdFirstOption(<a href="#ppd_file_t">ppd_file_t</a> *ppd);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">First option or <code>NULL</code></p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">Options are returned from all groups in ascending alphanumeric order.
|
||
|
||
</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ppdInstallableConflict">ppdInstallableConflict</a></h3>
|
||
<p class="description">Test whether an option choice conflicts with
|
||
an installable option.</p>
|
||
<p class="code">
|
||
int ppdInstallableConflict(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option, const char *choice);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Option</td></tr>
|
||
<tr><th>choice</th>
|
||
<td class="description">Choice</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">1 if conflicting, 0 if not conflicting</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function tests whether a particular option choice is available based
|
||
on constraints against options in the "InstallableOptions" group.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdIsMarked">ppdIsMarked</a></h3>
|
||
<p class="description">Check to see if an option is marked.</p>
|
||
<p class="code">
|
||
int ppdIsMarked(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option, const char *choice);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file data</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Option/Keyword name</td></tr>
|
||
<tr><th>choice</th>
|
||
<td class="description">Choice name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Non-zero if option is marked</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdLocalize">ppdLocalize</a></h3>
|
||
<p class="description">Localize the PPD file to the current locale.</p>
|
||
<p class="code">
|
||
int ppdLocalize(<a href="#ppd_file_t">ppd_file_t</a> *ppd);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">0 on success, -1 on error</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">All groups, options, and choices are localized, as are ICC profile
|
||
descriptions, printer presets, and custom option parameters. Each
|
||
localized string uses the UTF-8 character encoding.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdLocalizeAttr">ppdLocalizeAttr</a></h3>
|
||
<p class="description">Localize an attribute.</p>
|
||
<p class="code">
|
||
<a href="#ppd_attr_t">ppd_attr_t</a> *ppdLocalizeAttr(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *keyword, const char *spec);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>keyword</th>
|
||
<td class="description">Main keyword</td></tr>
|
||
<tr><th>spec</th>
|
||
<td class="description">Option keyword or <code>NULL</code> for none</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Localized attribute or <code>NULL</code> if none exists</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function uses the current locale to find the localized attribute for
|
||
the given main and option keywords. If no localized version of the
|
||
attribute exists for the current locale, the unlocalized version is returned.</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="ppdLocalizeIPPReason">ppdLocalizeIPPReason</a></h3>
|
||
<p class="description">Get the localized version of a cupsIPPReason
|
||
attribute.</p>
|
||
<p class="code">
|
||
const char *ppdLocalizeIPPReason(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *reason, const char *scheme, char *buffer, size_t bufsize);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>reason</th>
|
||
<td class="description">IPP reason keyword to look up</td></tr>
|
||
<tr><th>scheme</th>
|
||
<td class="description">URI scheme or NULL for text</td></tr>
|
||
<tr><th>buffer</th>
|
||
<td class="description">Value buffer</td></tr>
|
||
<tr><th>bufsize</th>
|
||
<td class="description">Size of value buffer</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Value or NULL if not found</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function uses the current locale to find the corresponding reason
|
||
text or URI from the attribute value. If "scheme" is NULL or "text",
|
||
the returned value contains human-readable (UTF-8) text from the translation
|
||
string or attribute value. Otherwise the corresponding URI is returned.<br>
|
||
<br>
|
||
If no value of the requested scheme can be found, NULL is returned.
|
||
|
||
</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ppdLocalizeMarkerName">ppdLocalizeMarkerName</a></h3>
|
||
<p class="description">Get the localized version of a marker-names
|
||
attribute value.</p>
|
||
<p class="code">
|
||
const char *ppdLocalizeMarkerName(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Marker name to look up</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Value or <code>NULL</code> if not found</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function uses the current locale to find the corresponding name
|
||
text from the attribute value. If no localized text for the requested
|
||
name can be found, <code>NULL</code> is returned.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdMarkDefaults">ppdMarkDefaults</a></h3>
|
||
<p class="description">Mark all default options in the PPD file.</p>
|
||
<p class="code">
|
||
void ppdMarkDefaults(<a href="#ppd_file_t">ppd_file_t</a> *ppd);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
</tbody></table>
|
||
<h3 class="function"><a id="ppdMarkOption">ppdMarkOption</a></h3>
|
||
<p class="description">Mark an option in a PPD file and return the number of
|
||
conflicts.</p>
|
||
<p class="code">
|
||
int ppdMarkOption(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *option, const char *choice);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>option</th>
|
||
<td class="description">Keyword</td></tr>
|
||
<tr><th>choice</th>
|
||
<td class="description">Option name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Number of conflicts</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdNextCustomParam">ppdNextCustomParam</a></h3>
|
||
<p class="description">Return the next parameter for a custom option.</p>
|
||
<p class="code">
|
||
<a href="#ppd_cparam_t">ppd_cparam_t</a> *ppdNextCustomParam(<a href="#ppd_coption_t">ppd_coption_t</a> *opt);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>opt</th>
|
||
<td class="description">Custom option</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Custom parameter or NULL</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ppdNextOption">ppdNextOption</a></h3>
|
||
<p class="description">Return the next option in the PPD file.</p>
|
||
<p class="code">
|
||
<a href="#ppd_option_t">ppd_option_t</a> *ppdNextOption(<a href="#ppd_file_t">ppd_file_t</a> *ppd);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Next option or <code>NULL</code></p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">Options are returned from all groups in ascending alphanumeric order.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdPageLength">ppdPageLength</a></h3>
|
||
<p class="description">Get the page length for the given size.</p>
|
||
<p class="code">
|
||
float ppdPageLength(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Size name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Length of page in points or 0.0</p>
|
||
<h3 class="function"><a id="ppdPageSize">ppdPageSize</a></h3>
|
||
<p class="description">Get the page size record for the named size.</p>
|
||
<p class="code">
|
||
<a href="#ppd_size_t">ppd_size_t</a> *ppdPageSize(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Size name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Size record for page or NULL</p>
|
||
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ppdPageSizeLimits">ppdPageSizeLimits</a></h3>
|
||
<p class="description">Return the custom page size limits.</p>
|
||
<p class="code">
|
||
int ppdPageSizeLimits(<a href="#ppd_file_t">ppd_file_t</a> *ppd, <a href="#ppd_size_t">ppd_size_t</a> *minimum, <a href="#ppd_size_t">ppd_size_t</a> *maximum);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>minimum</th>
|
||
<td class="description">Minimum custom size</td></tr>
|
||
<tr><th>maximum</th>
|
||
<td class="description">Maximum custom size</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">1 if custom sizes are supported, 0 otherwise</p>
|
||
<h4 class="discussion">Discussion</h4>
|
||
<p class="discussion">This function returns the minimum and maximum custom page sizes and printable
|
||
areas based on the currently-marked (selected) options.<br>
|
||
<br>
|
||
If the specified PPD file does not support custom page sizes, both
|
||
"minimum" and "maximum" are filled with zeroes.
|
||
|
||
</p>
|
||
<h3 class="function"><a id="ppdPageWidth">ppdPageWidth</a></h3>
|
||
<p class="description">Get the page width for the given size.</p>
|
||
<p class="code">
|
||
float ppdPageWidth(<a href="#ppd_file_t">ppd_file_t</a> *ppd, const char *name);</p>
|
||
<h4 class="parameters">Parameters</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>ppd</th>
|
||
<td class="description">PPD file record</td></tr>
|
||
<tr><th>name</th>
|
||
<td class="description">Size name</td></tr>
|
||
</tbody></table>
|
||
<h4 class="returnvalue">Return Value</h4>
|
||
<p class="description">Width of page in points or 0.0</p>
|
||
<h2 class="title"><a id="TYPES">Data Types</a></h2>
|
||
<h3 class="typedef"><a id="cups_interpret_cb_t">cups_interpret_cb_t</a></h3>
|
||
<p class="description">cupsRasterInterpretPPD callback function</p>
|
||
<p class="code">
|
||
typedef int (*cups_interpret_cb_t)(cups_page_header2_t *header, int preferred_bits);
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_attr_t"><span class="info"> DEPRECATED </span>ppd_attr_t</a></h3>
|
||
<p class="description">PPD Attribute Structure </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_attr_s">ppd_attr_s</a> ppd_attr_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_choice_t"><span class="info"> DEPRECATED </span>ppd_choice_t</a></h3>
|
||
<p class="description">Option choices </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_choice_s">ppd_choice_s</a> ppd_choice_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_conform_t"><span class="info"> DEPRECATED </span>ppd_conform_t</a></h3>
|
||
<p class="description">Conformance Levels </p>
|
||
<p class="code">
|
||
typedef enum <a href="#ppd_conform_e">ppd_conform_e</a> ppd_conform_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_const_t"><span class="info"> DEPRECATED </span>ppd_const_t</a></h3>
|
||
<p class="description">Constraints </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_const_s">ppd_const_s</a> ppd_const_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_coption_t"><span class="info"> DEPRECATED </span>ppd_coption_t</a></h3>
|
||
<p class="description">Custom Option </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_coption_s">ppd_coption_s</a> ppd_coption_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_cparam_t"><span class="info"> DEPRECATED </span>ppd_cparam_t</a></h3>
|
||
<p class="description">Custom Parameter </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_cparam_s">ppd_cparam_s</a> ppd_cparam_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_cplimit_t"><span class="info"> DEPRECATED </span>ppd_cplimit_t</a></h3>
|
||
<p class="description">Custom Parameter Limit </p>
|
||
<p class="code">
|
||
typedef union <a href="#ppd_cplimit_u">ppd_cplimit_u</a> ppd_cplimit_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_cptype_t"><span class="info"> DEPRECATED </span>ppd_cptype_t</a></h3>
|
||
<p class="description">Custom Parameter Type </p>
|
||
<p class="code">
|
||
typedef enum <a href="#ppd_cptype_e">ppd_cptype_e</a> ppd_cptype_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_cpvalue_t"><span class="info"> DEPRECATED </span>ppd_cpvalue_t</a></h3>
|
||
<p class="description">Custom Parameter Value </p>
|
||
<p class="code">
|
||
typedef union <a href="#ppd_cpvalue_u">ppd_cpvalue_u</a> ppd_cpvalue_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_cs_t"><span class="info"> DEPRECATED </span>ppd_cs_t</a></h3>
|
||
<p class="description">Colorspaces </p>
|
||
<p class="code">
|
||
typedef enum <a href="#ppd_cs_e">ppd_cs_e</a> ppd_cs_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_emul_t"><span class="info"> DEPRECATED </span>ppd_emul_t</a></h3>
|
||
<p class="description">Emulators </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_emul_s">ppd_emul_s</a> ppd_emul_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_file_t"><span class="info"> DEPRECATED </span>ppd_file_t</a></h3>
|
||
<p class="description">PPD File </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_file_s">ppd_file_s</a> ppd_file_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_group_t"><span class="info"> DEPRECATED </span>ppd_group_t</a></h3>
|
||
<p class="description">Groups </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_group_s">ppd_group_s</a> ppd_group_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_option_t"><span class="info"> DEPRECATED </span>ppd_option_t</a></h3>
|
||
<p class="description">Options </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_option_s">ppd_option_s</a> ppd_option_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_profile_t"><span class="info"> DEPRECATED </span>ppd_profile_t</a></h3>
|
||
<p class="description">sRGB Color Profiles </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_profile_s">ppd_profile_s</a> ppd_profile_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_section_t"><span class="info"> DEPRECATED </span>ppd_section_t</a></h3>
|
||
<p class="description">Order dependency sections </p>
|
||
<p class="code">
|
||
typedef enum <a href="#ppd_section_e">ppd_section_e</a> ppd_section_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_size_t"><span class="info"> DEPRECATED </span>ppd_size_t</a></h3>
|
||
<p class="description">Page Sizes </p>
|
||
<p class="code">
|
||
typedef struct <a href="#ppd_size_s">ppd_size_s</a> ppd_size_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_status_t"><span class="info"> DEPRECATED </span>ppd_status_t</a></h3>
|
||
<p class="description">Status Codes </p>
|
||
<p class="code">
|
||
typedef enum <a href="#ppd_status_e">ppd_status_e</a> ppd_status_t;
|
||
</p>
|
||
<h3 class="typedef"><a id="ppd_ui_t"><span class="info"> DEPRECATED </span>ppd_ui_t</a></h3>
|
||
<p class="description">UI Types </p>
|
||
<p class="code">
|
||
typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
|
||
</p>
|
||
<h2 class="title"><a id="STRUCTURES">Structures</a></h2>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_attr_s">ppd_attr_s</a></h3>
|
||
<p class="description">PPD Attribute Structure </p>
|
||
<p class="code">struct ppd_attr_s {<br>
|
||
    char name[PPD_MAX_NAME];<br>
|
||
    char spec[PPD_MAX_NAME];<br>
|
||
    char text[PPD_MAX_TEXT];<br>
|
||
    char *value;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>name[PPD_MAX_NAME] </th>
|
||
<td class="description">Name of attribute (cupsXYZ)</td></tr>
|
||
<tr><th>spec[PPD_MAX_NAME] </th>
|
||
<td class="description">Specifier string, if any</td></tr>
|
||
<tr><th>text[PPD_MAX_TEXT] </th>
|
||
<td class="description">Human-readable text, if any</td></tr>
|
||
<tr><th>value </th>
|
||
<td class="description">Value string</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_choice_s">ppd_choice_s</a></h3>
|
||
<p class="description">Option choices </p>
|
||
<p class="code">struct ppd_choice_s {<br>
|
||
    char choice[PPD_MAX_NAME];<br>
|
||
    char *code;<br>
|
||
    char marked;<br>
|
||
    <a href="#ppd_option_t">ppd_option_t</a> *option;<br>
|
||
    char text[PPD_MAX_TEXT];<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>choice[PPD_MAX_NAME] </th>
|
||
<td class="description">Computer-readable option name</td></tr>
|
||
<tr><th>code </th>
|
||
<td class="description">Code to send for this option</td></tr>
|
||
<tr><th>marked </th>
|
||
<td class="description">0 if not selected, 1 otherwise</td></tr>
|
||
<tr><th>option </th>
|
||
<td class="description">Pointer to parent option structure</td></tr>
|
||
<tr><th>text[PPD_MAX_TEXT] </th>
|
||
<td class="description">Human-readable option name</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_const_s">ppd_const_s</a></h3>
|
||
<p class="description">Constraints </p>
|
||
<p class="code">struct ppd_const_s {<br>
|
||
    char choice1[PPD_MAX_NAME];<br>
|
||
    char choice2[PPD_MAX_NAME];<br>
|
||
    char option1[PPD_MAX_NAME];<br>
|
||
    char option2[PPD_MAX_NAME];<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>choice1[PPD_MAX_NAME] </th>
|
||
<td class="description">First option/choice (blank for all)</td></tr>
|
||
<tr><th>choice2[PPD_MAX_NAME] </th>
|
||
<td class="description">Second option/choice (blank for all)</td></tr>
|
||
<tr><th>option1[PPD_MAX_NAME] </th>
|
||
<td class="description">First keyword</td></tr>
|
||
<tr><th>option2[PPD_MAX_NAME] </th>
|
||
<td class="description">Second keyword</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_coption_s">ppd_coption_s</a></h3>
|
||
<p class="description">Custom Option </p>
|
||
<p class="code">struct ppd_coption_s {<br>
|
||
    char keyword[PPD_MAX_NAME];<br>
|
||
    int marked;<br>
|
||
    <a href="#ppd_option_t">ppd_option_t</a> *option;<br>
|
||
    cups_array_t *params;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>keyword[PPD_MAX_NAME] </th>
|
||
<td class="description">Name of option that is being extended...</td></tr>
|
||
<tr><th>marked </th>
|
||
<td class="description">Extended option is marked</td></tr>
|
||
<tr><th>option </th>
|
||
<td class="description">Option that is being extended...</td></tr>
|
||
<tr><th>params </th>
|
||
<td class="description">Parameters</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_cparam_s">ppd_cparam_s</a></h3>
|
||
<p class="description">Custom Parameter </p>
|
||
<p class="code">struct ppd_cparam_s {<br>
|
||
    <a href="#ppd_cpvalue_t">ppd_cpvalue_t</a> current;<br>
|
||
    <a href="#ppd_cplimit_t">ppd_cplimit_t</a> minimum, maximum;<br>
|
||
    char name[PPD_MAX_NAME];<br>
|
||
    int order;<br>
|
||
    char text[PPD_MAX_TEXT];<br>
|
||
    <a href="#ppd_cptype_t">ppd_cptype_t</a> type;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>current </th>
|
||
<td class="description">Current value</td></tr>
|
||
<tr><th>maximum </th>
|
||
<td class="description">Maximum value</td></tr>
|
||
<tr><th>name[PPD_MAX_NAME] </th>
|
||
<td class="description">Parameter name</td></tr>
|
||
<tr><th>order </th>
|
||
<td class="description">Order (0 to N)</td></tr>
|
||
<tr><th>text[PPD_MAX_TEXT] </th>
|
||
<td class="description">Human-readable text</td></tr>
|
||
<tr><th>type </th>
|
||
<td class="description">Parameter type</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_emul_s">ppd_emul_s</a></h3>
|
||
<p class="description">Emulators </p>
|
||
<p class="code">struct ppd_emul_s {<br>
|
||
    char name[PPD_MAX_NAME];<br>
|
||
    char *start;<br>
|
||
    char *stop;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>name[PPD_MAX_NAME] </th>
|
||
<td class="description">Emulator name</td></tr>
|
||
<tr><th>start </th>
|
||
<td class="description">Code to switch to this emulation</td></tr>
|
||
<tr><th>stop </th>
|
||
<td class="description">Code to stop this emulation</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_file_s">ppd_file_s</a></h3>
|
||
<p class="description">PPD File </p>
|
||
<p class="code">struct ppd_file_s {<br>
|
||
    int accurate_screens;<br>
|
||
    int color_device;<br>
|
||
    <a href="#ppd_cs_t">ppd_cs_t</a> colorspace;<br>
|
||
    <a href="#ppd_const_t">ppd_const_t</a> *consts;<br>
|
||
    int contone_only;<br>
|
||
    float custom_margins[4];<br>
|
||
    float custom_max[2];<br>
|
||
    float custom_min[2];<br>
|
||
    char **filters;<br>
|
||
    int flip_duplex;<br>
|
||
    char **fonts;<br>
|
||
    <a href="#ppd_group_t">ppd_group_t</a> *groups;<br>
|
||
    char *jcl_begin;<br>
|
||
    char *jcl_end;<br>
|
||
    char *jcl_ps;<br>
|
||
    int landscape;<br>
|
||
    char *lang_encoding;<br>
|
||
    char *lang_version;<br>
|
||
    int language_level;<br>
|
||
    int manual_copies;<br>
|
||
    char *manufacturer;<br>
|
||
    int model_number;<br>
|
||
    char *modelname;<br>
|
||
    char *nickname;<br>
|
||
    int num_consts;<br>
|
||
    int num_filters;<br>
|
||
    int num_fonts;<br>
|
||
    int num_groups;<br>
|
||
    int num_profiles;<br>
|
||
    int num_sizes;<br>
|
||
    char *patches;<br>
|
||
    char *pcfilename;<br>
|
||
    char *product;<br>
|
||
    <a href="#ppd_profile_t">ppd_profile_t</a> *profiles;<br>
|
||
    char *protocols;<br>
|
||
    char *shortnickname;<br>
|
||
    <a href="#ppd_size_t">ppd_size_t</a> *sizes;<br>
|
||
    int throughput;<br>
|
||
    char *ttrasterizer;<br>
|
||
    int variable_sizes;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>accurate_screens </th>
|
||
<td class="description">1 = supports accurate screens, 0 = not</td></tr>
|
||
<tr><th>color_device </th>
|
||
<td class="description">1 = color device, 0 = grayscale</td></tr>
|
||
<tr><th>colorspace </th>
|
||
<td class="description">Default colorspace</td></tr>
|
||
<tr><th>consts </th>
|
||
<td class="description">UI/Non-UI constraints</td></tr>
|
||
<tr><th>contone_only </th>
|
||
<td class="description">1 = continuous tone only, 0 = not</td></tr>
|
||
<tr><th>custom_margins[4] </th>
|
||
<td class="description">Margins around page</td></tr>
|
||
<tr><th>custom_max[2] </th>
|
||
<td class="description">Maximum variable page size</td></tr>
|
||
<tr><th>custom_min[2] </th>
|
||
<td class="description">Minimum variable page size</td></tr>
|
||
<tr><th>filters </th>
|
||
<td class="description">Filter strings...</td></tr>
|
||
<tr><th>flip_duplex <span class="info"> DEPRECATED </span></th>
|
||
<td class="description">1 = Flip page for back sides </td></tr>
|
||
<tr><th>fonts </th>
|
||
<td class="description">Pre-loaded fonts</td></tr>
|
||
<tr><th>groups </th>
|
||
<td class="description">UI groups</td></tr>
|
||
<tr><th>jcl_begin </th>
|
||
<td class="description">Start JCL commands</td></tr>
|
||
<tr><th>jcl_end </th>
|
||
<td class="description">End JCL commands</td></tr>
|
||
<tr><th>jcl_ps </th>
|
||
<td class="description">Enter PostScript interpreter</td></tr>
|
||
<tr><th>landscape </th>
|
||
<td class="description">-90 or 90</td></tr>
|
||
<tr><th>lang_encoding </th>
|
||
<td class="description">Language encoding</td></tr>
|
||
<tr><th>lang_version </th>
|
||
<td class="description">Language version (English, Spanish, etc.)</td></tr>
|
||
<tr><th>language_level </th>
|
||
<td class="description">Language level of device</td></tr>
|
||
<tr><th>manual_copies </th>
|
||
<td class="description">1 = Copies done manually, 0 = hardware</td></tr>
|
||
<tr><th>manufacturer </th>
|
||
<td class="description">Manufacturer name</td></tr>
|
||
<tr><th>model_number </th>
|
||
<td class="description">Device-specific model number</td></tr>
|
||
<tr><th>modelname </th>
|
||
<td class="description">Model name (general)</td></tr>
|
||
<tr><th>nickname </th>
|
||
<td class="description">Nickname (specific)</td></tr>
|
||
<tr><th>num_consts </th>
|
||
<td class="description">Number of UI/Non-UI constraints</td></tr>
|
||
<tr><th>num_filters </th>
|
||
<td class="description">Number of filters</td></tr>
|
||
<tr><th>num_fonts </th>
|
||
<td class="description">Number of pre-loaded fonts</td></tr>
|
||
<tr><th>num_groups </th>
|
||
<td class="description">Number of UI groups</td></tr>
|
||
<tr><th>num_profiles <span class="info"> DEPRECATED </span></th>
|
||
<td class="description">Number of sRGB color profiles </td></tr>
|
||
<tr><th>num_sizes </th>
|
||
<td class="description">Number of page sizes</td></tr>
|
||
<tr><th>patches </th>
|
||
<td class="description">Patch commands to be sent to printer</td></tr>
|
||
<tr><th>pcfilename <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th>
|
||
<td class="description">PCFileName string </td></tr>
|
||
<tr><th>product </th>
|
||
<td class="description">Product name (from PS RIP/interpreter)</td></tr>
|
||
<tr><th>profiles <span class="info"> DEPRECATED </span></th>
|
||
<td class="description">sRGB color profiles </td></tr>
|
||
<tr><th>protocols <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th>
|
||
<td class="description">Protocols (BCP, TBCP) string </td></tr>
|
||
<tr><th>shortnickname </th>
|
||
<td class="description">Short version of nickname</td></tr>
|
||
<tr><th>sizes </th>
|
||
<td class="description">Page sizes</td></tr>
|
||
<tr><th>throughput </th>
|
||
<td class="description">Pages per minute</td></tr>
|
||
<tr><th>ttrasterizer </th>
|
||
<td class="description">Truetype rasterizer</td></tr>
|
||
<tr><th>variable_sizes </th>
|
||
<td class="description">1 = supports variable sizes, 0 = doesn't</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_group_s">ppd_group_s</a></h3>
|
||
<p class="description">Groups </p>
|
||
<p class="code">struct ppd_group_s {<br>
|
||
    char text[PPD_MAX_TEXT - PPD_MAX_NAME];<br>
|
||
    char name[PPD_MAX_NAME];<br>
|
||
    int num_options;<br>
|
||
    int num_subgroups;<br>
|
||
    <a href="#ppd_option_t">ppd_option_t</a> *options;<br>
|
||
    struct <a href="#ppd_group_s">ppd_group_s</a> *subgroups;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_MAX_NAME] </th>
|
||
<td class="description">Human-readable group name</td></tr>
|
||
<tr><th>name[PPD_MAX_NAME] <span class="info"> CUPS 1.1.18/macOS 10.3 </span></th>
|
||
<td class="description">Group name </td></tr>
|
||
<tr><th>num_options </th>
|
||
<td class="description">Number of options</td></tr>
|
||
<tr><th>num_subgroups </th>
|
||
<td class="description">Number of sub-groups</td></tr>
|
||
<tr><th>options </th>
|
||
<td class="description">Options</td></tr>
|
||
<tr><th>subgroups </th>
|
||
<td class="description">Sub-groups (max depth = 1)</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_option_s">ppd_option_s</a></h3>
|
||
<p class="description">Options </p>
|
||
<p class="code">struct ppd_option_s {<br>
|
||
    <a href="#ppd_choice_t">ppd_choice_t</a> *choices;<br>
|
||
    char conflicted;<br>
|
||
    char defchoice[PPD_MAX_NAME];<br>
|
||
    char keyword[PPD_MAX_NAME];<br>
|
||
    int num_choices;<br>
|
||
    float order;<br>
|
||
    <a href="#ppd_section_t">ppd_section_t</a> section;<br>
|
||
    char text[PPD_MAX_TEXT];<br>
|
||
    <a href="#ppd_ui_t">ppd_ui_t</a> ui;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>choices </th>
|
||
<td class="description">Option choices</td></tr>
|
||
<tr><th>conflicted </th>
|
||
<td class="description">0 if no conflicts exist, 1 otherwise</td></tr>
|
||
<tr><th>defchoice[PPD_MAX_NAME] </th>
|
||
<td class="description">Default option choice</td></tr>
|
||
<tr><th>keyword[PPD_MAX_NAME] </th>
|
||
<td class="description">Option keyword name ("PageSize", etc.)</td></tr>
|
||
<tr><th>num_choices </th>
|
||
<td class="description">Number of option choices</td></tr>
|
||
<tr><th>order </th>
|
||
<td class="description">Order number</td></tr>
|
||
<tr><th>section </th>
|
||
<td class="description">Section for command</td></tr>
|
||
<tr><th>text[PPD_MAX_TEXT] </th>
|
||
<td class="description">Human-readable text</td></tr>
|
||
<tr><th>ui </th>
|
||
<td class="description">Type of UI option</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_profile_s">ppd_profile_s</a></h3>
|
||
<p class="description">sRGB Color Profiles </p>
|
||
<p class="code">struct ppd_profile_s {<br>
|
||
    float density;<br>
|
||
    float gamma;<br>
|
||
    float matrix[3][3];<br>
|
||
    char media_type[PPD_MAX_NAME];<br>
|
||
    char resolution[PPD_MAX_NAME];<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>density </th>
|
||
<td class="description">Ink density to use</td></tr>
|
||
<tr><th>gamma </th>
|
||
<td class="description">Gamma correction to use</td></tr>
|
||
<tr><th>matrix[3][3] </th>
|
||
<td class="description">Transform matrix</td></tr>
|
||
<tr><th>media_type[PPD_MAX_NAME] </th>
|
||
<td class="description">Media type or "-"</td></tr>
|
||
<tr><th>resolution[PPD_MAX_NAME] </th>
|
||
<td class="description">Resolution or "-"</td></tr>
|
||
</tbody></table>
|
||
<h3 class="struct"><span class="info"> DEPRECATED </span><a id="ppd_size_s">ppd_size_s</a></h3>
|
||
<p class="description">Page Sizes </p>
|
||
<p class="code">struct ppd_size_s {<br>
|
||
    float bottom;<br>
|
||
    float left;<br>
|
||
    float length;<br>
|
||
    int marked;<br>
|
||
    char name[PPD_MAX_NAME];<br>
|
||
    float right;<br>
|
||
    float top;<br>
|
||
    float width;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>bottom </th>
|
||
<td class="description">Bottom printable margin in points</td></tr>
|
||
<tr><th>left </th>
|
||
<td class="description">Left printable margin in points</td></tr>
|
||
<tr><th>length </th>
|
||
<td class="description">Length of media in points</td></tr>
|
||
<tr><th>marked </th>
|
||
<td class="description">Page size selected?</td></tr>
|
||
<tr><th>name[PPD_MAX_NAME] </th>
|
||
<td class="description">Media size option</td></tr>
|
||
<tr><th>right </th>
|
||
<td class="description">Right printable margin in points</td></tr>
|
||
<tr><th>top </th>
|
||
<td class="description">Top printable margin in points</td></tr>
|
||
<tr><th>width </th>
|
||
<td class="description">Width of media in points</td></tr>
|
||
</tbody></table>
|
||
<h2 class="title"><a id="UNIONS">Unions</a></h2>
|
||
<h3 class="union"><span class="info"> DEPRECATED </span><a id="ppd_cplimit_u">ppd_cplimit_u</a></h3>
|
||
<p class="description">Custom Parameter Limit </p>
|
||
<p class="code">union ppd_cplimit_u {<br>
|
||
    float custom_curve;<br>
|
||
    int custom_int;<br>
|
||
    float custom_invcurve;<br>
|
||
    int custom_passcode;<br>
|
||
    int custom_password;<br>
|
||
    float custom_points;<br>
|
||
    float custom_real;<br>
|
||
    int custom_string;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>custom_curve </th>
|
||
<td class="description">Gamma value</td></tr>
|
||
<tr><th>custom_int </th>
|
||
<td class="description">Integer value</td></tr>
|
||
<tr><th>custom_invcurve </th>
|
||
<td class="description">Gamma value</td></tr>
|
||
<tr><th>custom_passcode </th>
|
||
<td class="description">Passcode length</td></tr>
|
||
<tr><th>custom_password </th>
|
||
<td class="description">Password length</td></tr>
|
||
<tr><th>custom_points </th>
|
||
<td class="description">Measurement value</td></tr>
|
||
<tr><th>custom_real </th>
|
||
<td class="description">Real value</td></tr>
|
||
<tr><th>custom_string </th>
|
||
<td class="description">String length</td></tr>
|
||
</tbody></table>
|
||
<h3 class="union"><span class="info"> DEPRECATED </span><a id="ppd_cpvalue_u">ppd_cpvalue_u</a></h3>
|
||
<p class="description">Custom Parameter Value </p>
|
||
<p class="code">union ppd_cpvalue_u {<br>
|
||
    float custom_curve;<br>
|
||
    int custom_int;<br>
|
||
    float custom_invcurve;<br>
|
||
    char *custom_passcode;<br>
|
||
    char *custom_password;<br>
|
||
    float custom_points;<br>
|
||
    float custom_real;<br>
|
||
    char *custom_string;<br>
|
||
};</p>
|
||
<h4 class="members">Members</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>custom_curve </th>
|
||
<td class="description">Gamma value</td></tr>
|
||
<tr><th>custom_int </th>
|
||
<td class="description">Integer value</td></tr>
|
||
<tr><th>custom_invcurve </th>
|
||
<td class="description">Gamma value</td></tr>
|
||
<tr><th>custom_passcode </th>
|
||
<td class="description">Passcode value</td></tr>
|
||
<tr><th>custom_password </th>
|
||
<td class="description">Password value</td></tr>
|
||
<tr><th>custom_points </th>
|
||
<td class="description">Measurement value</td></tr>
|
||
<tr><th>custom_real </th>
|
||
<td class="description">Real value</td></tr>
|
||
<tr><th>custom_string </th>
|
||
<td class="description">String value</td></tr>
|
||
</tbody></table>
|
||
<h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
|
||
<h3 class="enumeration"><a id="ppd_conform_e"><span class="info"> DEPRECATED </span>ppd_conform_e</a></h3>
|
||
<p class="description">Conformance Levels </p>
|
||
<h4 class="constants">Constants</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_CONFORM_RELAXED </th><td class="description">Relax whitespace and control char</td></tr>
|
||
<tr><th>PPD_CONFORM_STRICT </th><td class="description">Require strict conformance</td></tr>
|
||
</tbody></table>
|
||
<h3 class="enumeration"><a id="ppd_cptype_e"><span class="info"> DEPRECATED </span>ppd_cptype_e</a></h3>
|
||
<p class="description">Custom Parameter Type </p>
|
||
<h4 class="constants">Constants</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_CUSTOM_CURVE </th><td class="description">Curve value for f(x) = x^value</td></tr>
|
||
<tr><th>PPD_CUSTOM_INT </th><td class="description">Integer number value</td></tr>
|
||
<tr><th>PPD_CUSTOM_INVCURVE </th><td class="description">Curve value for f(x) = x^(1/value)</td></tr>
|
||
<tr><th>PPD_CUSTOM_PASSCODE </th><td class="description">String of (hidden) numbers</td></tr>
|
||
<tr><th>PPD_CUSTOM_PASSWORD </th><td class="description">String of (hidden) characters</td></tr>
|
||
<tr><th>PPD_CUSTOM_POINTS </th><td class="description">Measurement value in points</td></tr>
|
||
<tr><th>PPD_CUSTOM_REAL </th><td class="description">Real number value</td></tr>
|
||
<tr><th>PPD_CUSTOM_STRING </th><td class="description">String of characters</td></tr>
|
||
<tr><th>PPD_CUSTOM_UNKNOWN </th><td class="description">Unknown type (error)</td></tr>
|
||
</tbody></table>
|
||
<h3 class="enumeration"><a id="ppd_cs_e"><span class="info"> DEPRECATED </span>ppd_cs_e</a></h3>
|
||
<p class="description">Colorspaces </p>
|
||
<h4 class="constants">Constants</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_CS_CMY </th><td class="description">CMY colorspace</td></tr>
|
||
<tr><th>PPD_CS_CMYK </th><td class="description">CMYK colorspace</td></tr>
|
||
<tr><th>PPD_CS_GRAY </th><td class="description">Grayscale colorspace</td></tr>
|
||
<tr><th>PPD_CS_N </th><td class="description">DeviceN colorspace</td></tr>
|
||
<tr><th>PPD_CS_RGB </th><td class="description">RGB colorspace</td></tr>
|
||
<tr><th>PPD_CS_RGBK </th><td class="description">RGBK (K = gray) colorspace</td></tr>
|
||
</tbody></table>
|
||
<h3 class="enumeration"><a id="ppd_section_e"><span class="info"> DEPRECATED </span>ppd_section_e</a></h3>
|
||
<p class="description">Order dependency sections </p>
|
||
<h4 class="constants">Constants</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_ORDER_ANY </th><td class="description">Option code can be anywhere in the file</td></tr>
|
||
<tr><th>PPD_ORDER_DOCUMENT </th><td class="description">... must be in the DocumentSetup section</td></tr>
|
||
<tr><th>PPD_ORDER_EXIT </th><td class="description">... must be sent prior to the document</td></tr>
|
||
<tr><th>PPD_ORDER_JCL </th><td class="description">... must be sent as a JCL command</td></tr>
|
||
<tr><th>PPD_ORDER_PAGE </th><td class="description">... must be in the PageSetup section</td></tr>
|
||
<tr><th>PPD_ORDER_PROLOG </th><td class="description">... must be in the Prolog section</td></tr>
|
||
</tbody></table>
|
||
<h3 class="enumeration"><a id="ppd_status_e"><span class="info"> DEPRECATED </span>ppd_status_e</a></h3>
|
||
<p class="description">Status Codes </p>
|
||
<h4 class="constants">Constants</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_ALLOC_ERROR </th><td class="description">Memory allocation error</td></tr>
|
||
<tr><th>PPD_BAD_CLOSE_UI </th><td class="description">Bad CloseUI/JCLCloseUI</td></tr>
|
||
<tr><th>PPD_BAD_CUSTOM_PARAM </th><td class="description">Bad custom parameter</td></tr>
|
||
<tr><th>PPD_BAD_OPEN_GROUP </th><td class="description">Bad OpenGroup</td></tr>
|
||
<tr><th>PPD_BAD_OPEN_UI </th><td class="description">Bad OpenUI/JCLOpenUI</td></tr>
|
||
<tr><th>PPD_BAD_ORDER_DEPENDENCY </th><td class="description">Bad OrderDependency</td></tr>
|
||
<tr><th>PPD_BAD_UI_CONSTRAINTS </th><td class="description">Bad UIConstraints</td></tr>
|
||
<tr><th>PPD_BAD_VALUE </th><td class="description">Bad value string</td></tr>
|
||
<tr><th>PPD_FILE_OPEN_ERROR </th><td class="description">Unable to open PPD file</td></tr>
|
||
<tr><th>PPD_ILLEGAL_CHARACTER </th><td class="description">Illegal control character</td></tr>
|
||
<tr><th>PPD_ILLEGAL_MAIN_KEYWORD </th><td class="description">Illegal main keyword string</td></tr>
|
||
<tr><th>PPD_ILLEGAL_OPTION_KEYWORD </th><td class="description">Illegal option keyword string</td></tr>
|
||
<tr><th>PPD_ILLEGAL_TRANSLATION </th><td class="description">Illegal translation string</td></tr>
|
||
<tr><th>PPD_ILLEGAL_WHITESPACE </th><td class="description">Illegal whitespace character</td></tr>
|
||
<tr><th>PPD_INTERNAL_ERROR </th><td class="description">Internal error</td></tr>
|
||
<tr><th>PPD_LINE_TOO_LONG </th><td class="description">Line longer than 255 chars</td></tr>
|
||
<tr><th>PPD_MISSING_ASTERISK </th><td class="description">Missing asterisk in column 0</td></tr>
|
||
<tr><th>PPD_MISSING_CLOSE_GROUP </th><td class="description">Missing CloseGroup</td></tr>
|
||
<tr><th>PPD_MISSING_CLOSE_UI </th><td class="description">Missing CloseUI/JCLCloseUI</td></tr>
|
||
<tr><th>PPD_MISSING_OPTION_KEYWORD </th><td class="description">Missing option keyword</td></tr>
|
||
<tr><th>PPD_MISSING_PPDADOBE4 </th><td class="description">Missing PPD-Adobe-4.x header</td></tr>
|
||
<tr><th>PPD_MISSING_VALUE </th><td class="description">Missing value string</td></tr>
|
||
<tr><th>PPD_NESTED_OPEN_GROUP </th><td class="description">OpenGroup without a CloseGroup first</td></tr>
|
||
<tr><th>PPD_NESTED_OPEN_UI </th><td class="description">OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first</td></tr>
|
||
<tr><th>PPD_NULL_FILE </th><td class="description">NULL PPD file pointer</td></tr>
|
||
<tr><th>PPD_OK </th><td class="description">OK</td></tr>
|
||
</tbody></table>
|
||
<h3 class="enumeration"><a id="ppd_ui_e"><span class="info"> DEPRECATED </span>ppd_ui_e</a></h3>
|
||
<p class="description">UI Types </p>
|
||
<h4 class="constants">Constants</h4>
|
||
<table class="list"><tbody>
|
||
<tr><th>PPD_UI_BOOLEAN </th><td class="description">True or False option</td></tr>
|
||
<tr><th>PPD_UI_PICKMANY </th><td class="description">Pick zero or more from a list</td></tr>
|
||
<tr><th>PPD_UI_PICKONE </th><td class="description">Pick one from a list</td></tr>
|
||
</tbody></table>
|
||
</div>
|
||
</body>
|
||
</html>
|