Copyright © 2007 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This Working Draft defines features of the Scalable Vector Graphics (SVG) Language that are specifically for printing environments.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is a Last Call Working Draft. The W3C Membership and other interested parties are invited to review the document and send comments to to public-svg-print@w3.org (archives) until 8 February 2008. There is an accompanying SVG Print 1.2, Part 1: Primer that lists the ways SVG Print, along with other SVG documents, may be used for SVG Printing.
This document has been produced by the W3C SVG Working Group as part of the W3C Graphics Activity within the Interaction Domain. The Working Group expects to advance this Working Draft to Recommendation Status.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This draft of SVG Print is a snapshot of a work-in-progress.
The main purpose of this document is to encourage public feedback. The best way to give feedback is by sending an email to public-svg-print@w3.org. Please identify in the subject line of your message the part of the specificationto which your comment refers (e.g "Print compositing" or "Print render formats"). If you have comments on multiple areas of this document, then it is preferable to send several separate comments.
The public are welcome to comment on any aspect in this document, but there are a few areas in which the SVG Working Group are explicitly requesting feedback. These areas are noted in place within this document. There is also a specific area related to the specification that is listed here:
Interaction with other print standards. The SVG Working Group believe that some design decisions would be best made in collaboration with other print standards bodies, and would welcome liaison statements in this area.
This document lists features that may be used in the context of printing. The various usage scenarios are listed in the SVG Print Requirements document.
This document is normative.
This document contains explicit conformance criteria that overlap with some RNG definitions in requirements. If there is any conflict between the two, the explicit conformance criteria are the definitive reference.
This document contains conformance criteria for a number of different entities:
Some conformance criteria allow or require the User Agent for Printing and the User Agent for Print Preview to communicate with each other.
The conformance criteria have awkward names - any suggestions for replacing "A User Agent for Printing", "A User Agent for Print Preview", and "A User Agent for Printing or Print Preview" would be welcome.
TODO: The above terms will probably be replaced as follows:
A User Agent for Print Preview SHOULD, when requested to print, provide a mechanism for passing details for that printing to a User Agent for Printing. The mechanisms for doing so are covered by other specifications and are outside the scope of the present one.
A User Agent for Printing SHOULD provide a mechanism for accepting details for that printing (from a User Agent for Print Preview, or other sources). The mechanisms for doing so are covered by other specifications and are outside the scope of the present one.
A User Agent for Printing MUST NOT print any content if there is no pageSet element and if there is no content that would otherwise mark the SVG canvas.
A User Agent for Printing MUST comply with the Static Profile of SVG Tiny 1.2.
A User Agent for Print Preview MUST comply with the Static Profile of SVG Tiny 1.2.
The pageSet element is the container for a set of page elements.
<define name='pageSet'> <element name='pageSet'> <ref name='pageSet.AT'/> <zeroOrMore><ref name='page'/></zeroOrMore> </element> </define> <define name='pageSet.AT' combine='interleave'> <ref name='svg.Core.attr'/> </define>
A User Agent for Printing or Print Preview MUST treat all pageSet elements beyond the first as unsupported elements.
A User Agent for Printing or Print Preview MUST treat all children of a pageSet element as unsupported elements except for page elements, masterPage elements and use elements.
A User Agent for Printing or Print Preview MUST treat all elements from the SVG namespace between the closing pageSet tag and the closing svg tag as unsupported elements.
The page element appears only as a child of a pageSet element.
<define name='page'> <element name='page'> <ref name='page.AT'/> <zeroOrMore><ref name='svg.G.group'/></zeroOrMore> </element> </define> <define name='page.AT' combine='interleave'> <ref name='svg.Core.attr'/> <ref name='svg.page-orientation.attr'/> </define>
Conceptually, the page element is similar to an svg element but without transformation and positioning. All pages are in the coordinate system of their pageSet, which is in the coordinate system of the root svg element.
A User Agent for Printing or Print Preview MUST, when rendering a page, render only the children of the page, and any relevant Master Pages.
A User Agent for Printing or Print Preview MUST treat page elements that are not inside the pageSet element as unsupported elements.
Content that has references inside a page element MUST refer only to elements within the same page or in the SVG document before the pageSet element.
A User Agent for Printing or Print Preview MUST treat any references in a page that refer to content in a different page in the same document as unsupported.
Content MAY have references inside a page element that refer to external documents, but authors SHOULD use the externalResourcesRequired feature in this case.
A User Agent for Printing MAY discard a page element and all its children after that page element has been dealt with.
The masterPage element appears only as a child of a pageSet element.
<define name='masterPage'> <element name='masterPage'> <ref name='masterPage.AT'/> <zeroOrMore><ref name='svg.G.group'/></zeroOrMore> </element> </define> <define name='masterPage.AT' combine='interleave'> <ref name='svg.Core.attr'/> <ref name='svg.rendering-order.attr'/> </define>
A User Agent for Printing or Print Preview MUST NOT directly render any masterPage element or any of its children.
The rendering-order attribute may appear only on the masterPage element.
Attribute definition:
A Foreground Master Page is a Master Page with rendering-order set to "over".
A Background Master Page is a Master Page with rendering-order set to "under".
It is possible to have multiple Background Master Pages and/or Foreground Master Pages in an SVG Print document, though only one of each can be active at any given time. Whenever the renderer encounters a Background or Foreground Master Page, it replaces the current Background or Foreground Master Page with the new one, and subsequent pages use the newer one.
A User Agent for Printing or Print Preview MUST apply one Background Master Page and one Foreground Master Page to a displayed page. The Background Master Page and Foreground Master Page MUST be the ones most closely preceding the page in document order.
A User Agent for Printing or Print Preview MUST render content that is part of the Background Master Page on each displayed page, before the page content.
A User Agent for Printing or Print Preview MUST render content that is part of the Foreground Master Page on each displayed page, after the page content.
A User Agent for Printing or Print Preview MUST discard the Foreground Master Page and all its children when the next Foreground Master Page is parsed.
A User Agent for Printing or Print Preview MUST discard the Background Master Page and all its children when the next Background Master Page is parsed.
The default master pages are made available as a simple default that gives sensible printing behaviour for documents that do not have pageSet elements.
A User Agent for Printing or Print Preview MUST use all elements in the SVG document after the opening svg tag and before the opening pageSet tag as the initial Background Master Page, applying to all page elements that appear before the next Background Master Page in document order.
A User Agent for Printing or Print Preview MUST set the initial Foreground Master Page to be empty.
Note that, as a consequence of the foregoing conformance statements, the default background master page (all the elements between the svg element and the pageSet element) is no longer used as a default master page when another background master page is set. Elements in the defs element of an svg document will be available to all pages in the pageSet element.
Content that has MasterPage elements SHOULD NOT make use of the default background master page (ie. should not have content between the svg element and the pageSet element).
A User Agent for Printing MAY allow control over the job information (e.g. JDF), by means of an encapsulation of an SVG file or document fragment.
A User Agent for Printing or Print Preview MAY, when requested to print an SVG document, and in the absence of conflicting Job Control information, provide a means for selecting which pages to print.
A User Agent for Printing SHOULD, when requested to print an SVG document, and in the absence of conflicting Job Control information, print all pages, in the order in which the pages appear in the SVG document.
If an SVG document fragment with multiple pages is embedded in, or referenced by, a document from another namespace, such as XHTML, then typically it is up to that namespace to define the processing of pages.
The orientation of each page element can be controlled by the page-orientation property. This enables the content to define whether a portrait or landscape mode is used for display and printing.
Value: | -270 | -180 | -90 | 0 | 90 | 180 | 270 |
Initial: | 0 |
Applies to: | page elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual print |
Animatable: | yes |
When displaying a page on a User Agent for Print Preview, the value of the page-orientation property introduces the following transform before the top-level viewport transformation:
The values for width and height are the dimensions of the top-level viewBox in the user coordinate system or the dimensions of the top-level viewport if there is no viewBox specified.
A User Agent for Printing or Print Preview MUST display each page with the orientation as specified by page-orientation.
The use-master-page attribute may appear only on a use element referencing an external page element.
Attribute definition:
Both the current Foreground Master Page and Background Master Page of the referencing document must be used when use-master-page is set to current.
Both the current Foreground Master Page and Background Master Page of the externally referenced document must be used when use-master-page is set to external.
By default, if the use-master-page attribute is not specified on the use element referencing an external page, then both the current Foreground Master Page and Background Master Page of the referencing document must be used.
A User Agent for Printing or Print Preview MUST use the current Foreground Master Page and Background Master Page of the referencing document when use-master-page is set to a value of current.
A User Agent for Printing or Print Preview MUST use the current Foreground Master Page and Background Master Page of the externally referenced document when use-master-page is set to a value of external.
A User Agent for Printing or Print Preview MUST use the current Foreground Master Page and Background Master Page of the referencing document if use-master-page is not set on the use element.
TODO: Need feedback on this feature. Are there compelling uses cases for having this extra complexity? What benefit does it provide?
Attribute definition:
A User Agent for Printing or Print Preview MUST, for the purposes of printing or print preview, treat a value of noPrint for the print-display attribute as though the element has display=none.
TODO: Need feedback on this feature. display-print is a replacement for noPrint. The attribute was originally a boolean. This changes is still under consideration. The following alternatives are available:
Content that uses CSS SHOULD define all styles for use in the entire document at the start of the SVG document, prior to any page elements.
Content intended for print applications SHOULD be authored using presentation attributes exclusively.
A User Agent for Printing MUST NOT run any script or start any animation in the SVG document.
A User Agent for Print Preview MUST NOT run any script or start any animation in any page being displayed.
SVG Print extends the control of color, relative to SVG Tiny 1.2, in two ways. Firstly by adding an additional color space for interpolation and compositing; this means that colors are no longer constrained to the sRGB gamut. Secondly by extending the syntax for Paint, thus allowing colors to be specified as calibrated (ICC and named) and uncalibrated ('device') color.
The color-interpolation property, not in SVG Tiny 1.2 but used in SVG 1.1 [SVG11], is extended by this specification to add new values using the CIE L*a*b* color space. Both the cartesian (CIE-Lab) and polar (CIE-LCHab) forms are supported.
A User Agent for Printing or Print Preview MUST use the color space defined by color-interpolation for calculations when interpolating between gradient stops and alpha compositing of graphics elements into the current background.
Value: | auto | sRGB | linearRGB | CIE-Lab | CIE-LCHab | inherit |
Initial: | sRGB |
Applies to: | container elements, graphics elements and 'animateColor' |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
The 'color-interpolation' property specifies the color space for gradient interpolations and alpha compositing.
When a child element is blended into a background, the value of the 'color-interpolation' property on the child determines the type of blending, not the value of the 'color-interpolation' on the parent.
The definition of paint in SVG Tiny 1.2 [SVGT12] is extended by this specification to add the icc-color values from paint in SVG Full 1.1 [SVG11] and also to add new values for named colors and uncalibrated (device) colors.
<paint> : | none | currentColor | <color> | <color> icc-color(<name> [,<icccolorvalue>]*) | <color> icc-named-color(<name>, <namedColor>) | <color> device-color(<name> [,<devicecolorvalue>]*) | <FuncXMLRI> [ none | currentColor | <color>] | <system paint> | inherit |
TODO: Need feedback on this feature. Looking into the possibility of having ICC or Name ICC fallback for Device Color as well. ICC or Named ICC should have priority over an sRGB fallback if both types of fallback are specified.
Note that by default, color interpolation occurs in the sRGB color space, even if an ICC-based color specification is provided, unless the 'color-interpolation' property is set to one of the CIE Lab color spaces. If an sRGB color interpolation space is specified, all ICC-based colors used for the interpolation must be converted into the sRGB interpolation colorspace.
As with SVG Tiny 1.2, colors may be specified in the sRGB color space (see [sRGB]). Since all SVG Print and SVG Print Preview User Agents are color management capable, the rendering requirements are more strict than for SVG User Agents [SVG11] where color management is optional.
When an sRGB color is used - because it is the sole color specification, or in a permitted fallback situation - a conformant SVG Print or SVG Print Preview User Agent shall render it in conformance with the ICC profile for sRGB to obtain the desired color appearance.
As with SVG Full 1.1, SVG Print content may specify color using an ICC profile (see [ICC42]). For resiliency and for compatibility with SVG Tiny 1.2, an sRGB fallback must still be provided.
If ICC-based colors are provided, a conformant SVG Print or SVG Print Preview user agent MUST use the the ICC-based color in preference to the sRGB fallback color, unless the ICC color profile is unavailable, malformed, or uses a profile connection space other than CIE XYZ or CIE LAB.
When an ICC color is used, a conformant SVG Print or SVG Print Preview User Agent shall render it in conformance with the specified ICC profile to obtain the desired color appearance.
SVG Print introduces the ability to specify a color using a 'Named Color Profile'.
If ICC-based named colors are provided, a conformant SVG Print or SVG Print Preview user agent MUST use the the ICC-based named color in preference to the sRGB fallback color, unless the ICC named color profile is unavailable, malformed, or uses a profile connection space other than CIE XYZ or CIE LAB.
When an ICC named color is used, a conformant SVG Print or SVG Print Preview User Agent shall render it in conformance with the specified ICC profile to obtain the desired color appearance.
SVG Print also introduces a method of specifying uncallibrated device colors. This is sometimes useful in print workflows. This feature utilises the deviceColor element and the device-color keyword.
As these are uncalibrated, any interpolation or compositing occurs using the fallback sRGB color space
TODO: Need feedback on this feature. Looking into the possibility of having ICC or Name ICC fallback for Device Color as well. ICC or Named ICC should have priority over an sRGB fallback if both types of fallback are specified.
The International Color Consortium has established a standard, the ICC Profile [ICC32], for documenting the color characteristics of input and output devices. Using these profiles, it is possible to build a transform and correct visual data for viewing on different devices.
A color profile description provides the bridge between an ICC profile and references to that ICC profile within SVG content. The color profile description is added to the user agent's list of known color profiles and then used to select the relevant profile. The color profile description contains descriptors for the location of the color profile on the Web, a name to reference the profile and information about rendering intent.
Color profile descriptions can be specified in either of the following ways:
If a color profile with the same name value has been identified by both a 'color-profile' element and @color-profile rules within a CSS style sheet, then the user agent MUST first attempt to locate the profile by using the specifications in the @color-profile rules first.
<define name='color-profile'> <element name='color-profile'> <ref name='color-profile.AT'/> <empty/> </element> </define> <define name='color-profile.AT' combine='interleave'> <ref name='svg.Core.attr'/> <ref name='svg.local.attr'/> <ref name='svg.name.attr'/> <ref name='svg.rendering-intent.attr'/> </define>
Attribute definitions:
'rendering-intent' permits the specification of a color profile rendering intent other than the default. 'rendering-intent' is applicable primarily to color profiles corresponding to CMYK color spaces. The different options cause different methods to be used for translating colors to the color gamut of the target rendering device:
When the document is styled using CSS, the @color-profile rule can be used to specify a color profile description. The general form is:
@color-profile { <color-profile-description> }
where the <color-profile-description> has the form:
descriptor: value; [...] descriptor: value;
Each @color-profile rule specifies a value for every color profile descriptor, either implicitly or explicitly. Those not given explicit values in the rule take the initial value listed with each descriptor in this specification. These descriptors apply solely within the context of the @color-profile rule in which they are defined, and do not apply to document language elements. Thus, there is no notion of which elements the descriptors apply to, or whether the values are inherited by child elements.
The following are the descriptors for a <color-profile-description>:
"local(" + <string> + ")"where <string> is the profile's unique ID as specified by International Color Consortium. (Note: Profile description fields do not represent a profile's unique ID. With current ICC proposals, the profile's unique ID is an MD5-encoded value within the profile header.)
Values: | <name> |
Initial: | undefined |
Media: | visual |
Values: | auto | perceptual | relative-colorimetric | saturation | absolute-colorimetric |
Initial: | auto |
Media: | visual |
Animatable: | no |
See the description for the rendering-intent attribute on the 'color-profile' element.
TODO: Need some conformance criteria. Also, this reiterates some of the color-profile element stuff, so we should reference that more here.
Value: | auto | sRGB | <name> | <iri> | inherit |
Initial: | auto |
Applies to: | 'image' elements that refer to raster images |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
TODO: Need some conformance criteria. Also, need to reference color-profile element.
Certain print applications can improve printing quality by specifying colors by name or in an alternative color format. This is commonly referred to as using 'spot' colors, device colors or inks, and usually means that a particular ink will be used for the color when it is printed. Furthermore, there are applications in the printing press industry where presses can be set up with different inks for different jobs. This means that the content creator will need to create content tailored to the particular press setup in order to obtain the best results.
The deviceColor element can be used to indicate an alternative color for a particular paint. This element will be mostly used in closed workflows, since the names of the inks and the parameters (percentages of each ink's color components) rarely have meaning outside the domain of the target device.
<xs:element name="deviceColor"> <xs:complexType> <xs:attribute ref="href" use="required" namespace="http://www.w3.org/1999/xlink"/> <xs:attribute ref="name" use="required" type="string"/> <xs:anyAttribute namespace="##any" processContents="skip"/> </xs:complexType> </xs:element>
TODO: This needs to be converted to RNG
A URI used to identify the device-specific information included in this element. If the User Agent does not recognize the URI (ie. is not able to recognize the particular device parameters) then the element should be ignored and should not be part of the rendering process.
Animatable: | no |
The name of this device-specific color information. The name attribute is used within the device-color specification within <paint> to reference this deviceColor element.
Animatable: | no |
The deviceColor element uses attributes from external namespaces to define the device specific properties that are to be used when the deviceColor is referenced from a <paint>.
The following example illustrates the use of deviceColor. There are two things to note:
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ecpi="http://www.example.com/press/inks"> <defs> <!-- describe a particular output device --> <deviceColor name="device-inks" xlink:href="http://www.example.com/pressInks" ecpi:value="Cyan, Magenta, Yellow, Black, Silver, Gray, Green"/> </defs> <text x="100" y="150" font-family="Verdana" font-size="35" fill="rgb(22,33,44) device-color(device-inks, 11,55,66,77,0,0,88)" > Hello, out there </text> </svg>
In the example above, a supplemental attribute, value, from a private namespace has been added. This example value attribute provides the definitions of colors or inks to be interpreted in the context of the URI specified. It is in a private namespace so that content and context authors can use any understood format to convey the necessary information. When the particular deviceColor element is referenced later by a device-color keyword specification, it is generally expected that the number of parameters following the name reference (1st parameter) in the function-like representation for the value of device-color alternate in a fill or stroke attribute (for example) will have an understood one-to-one correspondence with the information specified for the value attribute in the the deviceColor element. The interpretation of the parameters is implied specifically by the context set by the URI.
TODO: Need some conformance criteria.