Prince
  • Buy Prince
  • Samples
  • Documentation
  • Forum
  • Download
  • Installation Guide
  • User Guide
  • Reference Guide

Contents

  • 1. Getting Started
    • Installing Prince
      • Installing Prince on Windows
      • Installing Prince on MacOS X
      • Installing Prince on Linux
        • Debian and Ubuntu
        • Redhat and CentOS
        • OpenSUSE
        • FreeBSD, Solaris and Generic Linux
      • Installing a license file
      • Installation Layout
        • Windows installation layout
        • MacOS X installation layout
        • Linux installation layout
    • Your First Document
      • The lab report
      • Processing the document
      • Styling the document
  • 2. Styling
    • Fonts
      • Defining a font family
      • Generic font families
      • OpenType Features in Prince
      • Redefining the generic font families
    • Layout
      • Text formatting
      • Paragraph formatting
      • Writing Mode
      • CSS Box Model
        • Margin
        • Padding
        • Border
        • Background
      • Tables
        • Automatic table layout
        • Fixed table layout
        • Separated table borders
        • Collapsing table borders
        • Cells that span columns
        • Cells that span rows
        • Numbering table rows
        • Running table headers and footers
        • Table captions
      • Lists
        • List marker position
        • List marker type
        • List marker style
      • Columns
      • Floats
        • Prince extensions to floats
      • Footnotes
        • Footnote calls
        • Footnote markers
        • Styling footnotes
    • Paged Media
      • Page size
      • Page style
      • Trimming marks
      • Page regions
        • Generated content in page regions
      • Selecting pages
        • Blank pages
      • Controlling pagination
        • Page breaks
        • Widows and orphans
  • 3. Scripting
    • JavaScript in Printed Media
    • Logging
    • Console access
    • Event handling
    • Document statistics
    • PDF properties
    • Unsupported DOM properties
  • 4. Graphics
    • Color
      • RGB
      • RGBA
      • CMYK
      • Spot colors
    • Color Management
      • Introduction
      • Color Management and PDF Profiles
      • Color Management in Prince
      • Color conversion
      • Rich black and true black
      • Page color space
    • Filters
    • Images
      • Images in XHTML
      • Images in DocBook
      • Images in Arbitrary XML
      • CSS and Images
        • Image Size in Print
    • Scalable Vector Graphics (SVG)
      • Viewbox and viewport
      • Rectangles
      • Circles
      • Ellipses
      • Lines
      • Masks
      • Polylines
      • Polygons
      • Paths
      • Text
      • Images
      • Links
      • Transformations
      • Style Properties
    • Rasterization
  • 5. Prince Tips and Tricks
    • Generated Content
      • Page headers and footers
      • List markers
      • Footnote markers
      • Before and After pseudo-elements
      • Counters and Numbering
        • Counter reset and increment
        • Nested counters
        • Counter styles
      • Cross-references
        • Using target-counter
        • Using target-content
      • Script Functions
        • Accessing the current date and time
        • User-defined counter styles
      • Using generated content in page regions
      • Copying text content from the document
      • Taking elements from the document
    • Advanced paged media examples
      • Named pages
      • Page groups
      • Page breaks and decoration
      • Printing wide content sideways
    • Hyphenation
    • Typographic Ligatures
    • Watermarks
    • Rotating content in table cells
    • The "Two-Pass" Solution
  • 6. Help
    • Troubleshooting
      • Missing glyphs or fonts
      • Fontconfig
      • Image formats
      • Shared library trouble
      • PATH issues
      • The capture/replay system
      • Running the debug script
    • Frequently Asked Questions
  • 7. Prince Input
    • Applying Style Sheets in Prince
      • Importing Style Sheets
      • Conflicting Declarations
      • Priority Determination
    • Applying JavaScript in Prince
    • XML Input
      • XML Input
        • Validation
        • xml:lang
        • xml:id
        • xml:base
      • XML Styling
      • XML Inclusions (XInclude)
        • Including XML files
        • Including text files
        • Fallback
  • 8. Prince Output
    • PDF Profiles
      • PDF/A
      • PDF/X
    • PDF Output Options
      • PDF Links
      • PDF Actions
      • PDF Pages
      • PDF Printing
      • PDF Compression
      • Font Embedding
      • Creating PostScript output
    • PDF Bookmarks
      • Bookmark levels
      • Bookmark labels
      • Bookmark targets
    • PDF Metadata
      • XMP Metadata
  • 9. Server Integration
    • Security and performance
    • Prince Wrappers
      • Third-Party Wrappers
      • Using Prince from Java
      • Using Prince from .NET with C#
      • Using Prince from .NET with VB.NET
      • Using Prince from Python
      • Using Prince from Perl
      • Using Prince from PHP
      • Using Prince from ASP
      • Using Prince from ColdFusion
      • Using Java
      • Using ActiveX/COM
      • Using Prince from ActiveX / COM / Visual Basic
    • Advanced Command Line Options
      • Prince Control Protocol
      • Structured Log

Reference Guide

  • A1. Command-line Reference
    • Examples
    • Specifying input and output
    • Options
      • General Options
      • Logging Options
      • Input Options
      • Network Options
      • JavaScript Options
      • CSS Options
      • PDF Output Options
      • PDF Metadata Options
      • PDF Encryption Options
      • Raster Output Options
      • Utility Options
      • Advanced Control and Log Options
  • A2. CSS References
    • CSS Features
    • Length Units
      • Absolute Length Units
      • Font Length Units
      • Pixel Unit
  • A3. CSS Properties
    • alternate-color
    • background
    • background-attachment
    • background-clip
    • background-color
    • background-image
    • background-origin
    • background-position
    • background-repeat
    • background-size
    • baseline-shift
    • border
    • border-bottom
    • border-bottom-color
    • border-bottom-left-radius
    • border-bottom-right-radius
    • border-bottom-style
    • border-bottom-width
    • border-clip
    • border-collapse
    • border-color
    • border-left
    • border-left-color
    • border-left-style
    • border-left-width
    • border-radius
    • border-right
    • border-right-color
    • border-right-style
    • border-right-width
    • border-spacing
    • border-style
    • border-top
    • border-top-color
    • border-top-left-radius
    • border-top-right-radius
    • border-top-style
    • border-top-width
    • border-width
    • bottom
    • box-decoration-break
    • box-sizing
    • caption-side
    • clear
    • clip
    • clip-path
    • clip-rule
    • color
    • column-break-after
    • column-break-before
    • column-count
    • column-fill
    • column-gap
    • column-rule
    • column-rule-color
    • column-rule-style
    • column-rule-width
    • column-span
    • column-width
    • columns
    • content
    • counter-increment
    • counter-reset
    • direction
    • display
    • dominant-baseline
    • empty-cells
    • fill
    • fill-opacity
    • fill-rule
    • filter
    • float
    • font
    • font-family
    • font-size
    • font-stretch
    • font-style
    • font-variant
    • font-weight
    • footnote-display
    • footnote-style-position
    • height
    • hyphens
    • left
    • letter-spacing
    • line-height
    • line-stacking-strategy
    • list-style
    • list-style-image
    • list-style-position
    • list-style-type
    • margin
    • margin-bottom
    • margin-inside
    • margin-left
    • margin-outside
    • margin-right
    • margin-top
    • marker-end
    • marker-mid
    • marker-start
    • marks
    • mask
    • max-height
    • max-width
    • min-height
    • min-width
    • opacity
    • orphans
    • overflow
    • overflow-wrap
    • padding
    • padding-bottom
    • padding-left
    • padding-right
    • padding-top
    • page
    • page-break-after
    • page-break-before
    • page-break-inside
    • position
    • prince-background-image-resolution
    • prince-bleed
    • prince-bookmark-label
    • prince-bookmark-level
    • prince-bookmark-state
    • prince-bookmark-target
    • prince-caption-page
    • prince-fallback-cmyk-profile
    • prince-filter-resolution
    • prince-flow
    • prince-footnote-policy
    • prince-forced-breaks
    • prince-hyphenate-after
    • prince-hyphenate-before
    • prince-hyphenate-character
    • prince-hyphenate-lines
    • prince-hyphenate-patterns
    • prince-image-magic
    • prince-image-resolution
    • prince-linebreak-magic
    • prince-link
    • prince-mark-length
    • prince-mark-offset
    • prince-mark-width
    • prince-page-group
    • prince-pdf-color-conversion
    • prince-pdf-color-options
    • prince-pdf-destination
    • prince-pdf-duplex
    • prince-pdf-link-type
    • prince-pdf-open-action
    • prince-pdf-output-intent
    • prince-pdf-page-colorspace
    • prince-pdf-page-label
    • prince-pdf-page-layout
    • prince-pdf-page-mode
    • prince-pdf-paper-tray
    • prince-pdf-print-scaling
    • prince-pdf-profile
    • prince-pdf-script
    • prince-pdf-xmp
    • prince-rotate-body
    • prince-shrink-to-fit
    • prince-text-justify
    • prince-text-replace
    • prince-tooltip
    • prince-trim
    • prince-wrap-inside
    • right
    • size
    • src
    • stop-color
    • stop-opacity
    • string-set
    • stroke
    • stroke-dasharray
    • stroke-dashoffset
    • stroke-linecap
    • stroke-linejoin
    • stroke-miterlimit
    • stroke-opacity
    • stroke-width
    • table-baseline
    • table-column-span
    • table-layout
    • table-row-span
    • text-align
    • text-align-last
    • text-anchor
    • text-decoration
    • text-indent
    • text-line-through
    • text-line-through-color
    • text-line-through-style
    • text-overflow
    • text-overline
    • text-overline-color
    • text-overline-style
    • text-transform
    • text-underline
    • text-underline-color
    • text-underline-style
    • top
    • transform
    • transform-origin
    • unicode-bidi
    • unicode-range
    • vertical-align
    • visibility
    • white-space
    • widows
    • width
    • word-break
    • word-spacing
    • writing-mode
    • z-index
  • A4. CSS Selectors
    • Terminology and Definitions
    • Logical Combinations
    • Elemental Selectors
    • Attribute Selectors
    • Linguistic Pseudo-classes
    • Location Pseudo-classes
    • Tree-Structural pseudo-classes
    • Combinators
    • Tree-Abiding Pseudo-element Selectors
    • Typographic Pseudo-element Selectors
    • Footnote Pseudo-element Selectors
    • Page Selectors
  • A5. CSS Media Queries
    • Media Queries
    • Media Query Modifiers
    • Media Types
    • Media Features
    • Dimension Media Features
    • Display Quality Media Features
    • Color Media Features
    • Interaction Media Features
    • Scripting Media Features
  • A6. CSS Functional Expressions
    • CSS Functions
    • Prince Specific Functions
  • A7. CSS At-rules
    • Initial At-Rules
    • Nested At-Rules
  • A8. Page Size Keywords
  • A9. Character Entities
    • Accented Letters
    • Symbols
    • Quotes
    • Accents
    • Miscellaneous
  • A10. Acknowledgements

Color Management

Introduction

The purpose of color management is to keep the appearance of colors consistent as they are converted between different devices and media. This is e.g. of advantage when preparing a PDF file on a computer screen before sending it to a printer - the desireable result will be to have a print that looks as close as possible to the display on the screen. Perfect equivalence is not possible, also not least because of the difference between a device with reflected light, such as paper, and one with direct light, such as a screen, but color management helps to achieve a close match in perception.

The conversion of color is facilitated by profiling devices; the set of data that characterizes a device or color space, i.e. the color attributes of the device, is kept as an ICC color profile. Color profiles are often embedded in image files to denote the color space of the image. When the color space is not known, color values are essentially arbitrary numbers without a physical interpretation.

The aim of Prince, within a color-managed workflow, is to preserve color information (namely, color profiles) from the input documents and images, through to the PDF output file.

Color Management and PDF Profiles

As described in the PDF Profiles section, both PDF/A and PDF/X profiles impose restrictions on the features that may be used in a PDF file, including restrictions on color.

PDF/A and PDF/X files have an output intent that defines the intended output color space of the PDF file. In Prince, the output intent color profile is selected using the --pdf-output-intent command-line option, or using the prince-pdf-output-intent property inside a @prince-pdf at-rule. Both take a filename or URL to an ICC profile as its value.

@prince-pdf {
    prince-pdf-output-intent: url("ISOcoated_v2_eci.icc")
}

For PDF/X, the output intent must be given as it describes the intended printing process. For PDF/A, Prince assumes an sRGB ICC profile if an output intent is not given.

Briefly, the restrictions on color imposed by PDF/X are:

PDF/X-1a
All color data must be Grayscale, CMYK or named Spot Colors.
All colors must be characterised by the output intent - Prince implicitly performs color conversions.
PDF/X-3
Allows other color spaces but colors must be device-independent, or else characterised by the output intent.
PDF/X-4
Allows other color spaces but colors must be device-independent, or else characterised by the output intent. PDF transparency is supported.

PDF/A requires that all colors to be device-independent, or else characterised by the output intent (thus making them device-independent).

Color Management in Prince

Prince supports RGB, RGBA, CMYK, and named spot colors. For Prince's color handling, please see the Color section.

As CSS defines RGB colors in the sRGB color space, Prince tags those colors with an sRGB ICC profile in the PDF output. See also the section on Rich black and true black below.

CMYK colors specified using the cmyk() function syntax, or equivalent device-cmyk() syntax, represent device-dependent colors, so they will be left as such in the PDF when possible. Device-dependent color is not allowed in PDF/A or PDF/X, so those CMYK colors will be assumed to be either in the output intent color space (if it is CMYK), or else the color space of the fallback CMYK profile. See the command line option --fallback-cmyk-profile in the PDF Output Options section, or the prince-fallback-cmyk-profile property.

prince input.html --pdf-profile=PDF/A-1b --pdf-output-intent=sRGB.icc --fallback-cmyk-profile=ISOcoated_v2_eci.icc
@prince-pdf {
    prince-pdf-output-intent: url("sRGB.icc");
	prince-fallback-cmyk-profile: url("ISOcoated_v2_eci.icc");
}

Prince preserves the ICC profiles embedded in bitmap images, unless directed not to (see the ignore-icc-profile value of the prince-image-magic property). If an image does not have an embedded ICC profile, the behaviour depends on the color model of the image. Untagged RGB images will be assumed to be in the sRGB color space. Untagged CMYK images will, when necessary, be assumed to be either in the output intent color space (if it is CMYK), or else the color space of the fallback CMYK profile. Untagged grayscale images will be left as DeviceGray in the PDF (in PDF/A and PDF/X, it means it is characterized by the output intent color space).

Color conversion

Prince will convert all the colors in a document to a single color space if the --convert-colors command-line option or the prince-pdf-color-conversion is used. The destination color space is specified with the --pdf-output-intent option (or the prince-pdf-output-intent property), even when not producing PDF/A or PDF/X files.

Prince automatically converts colors to the output intent color space when producing PDF/X-1a files.

Rich black and true black

In printing, "rich black" is a mixture of CMYK ink colors to produce a darker tone than using the black ink alone ("true black").

The property prince-pdf-color-options controls the encoding of CSS RGB values representing black and grays, i.e. RGB colors with equal values of red, green and blue.

When the value use-true-black is used, such an RGB value will be encoded in the DeviceGray color space in the PDF. A CMYK printer should print the gray level using only the black ink. This is the default setting of Prince.

On the other hand, the use-rich-black value instructs Prince to keep all RGB colors as RGB in the PDF. A CMYK printer should print RGB colors using a mixture of all four CMYK inks.

@prince-pdf {
    prince-pdf-color-options: use-rich-black;
}

Color conversion takes into account the use-true-black value when converting CSS RGB values to CMYK. True blacks and grays will be converted to CMYK with only non-zero values in the K channel. Note, however, that this does not affect bitmap images.

Page color space

The property prince-pdf-page-colorspace controls the color space of pages in the PDF file. It affects the compositing of transparent content onto the page by selecting the color space in which compositing is performed. Prince currently defaults to the RGB color space. It may be useful to set this property to avoid converting the colors of transparent content before it is composited onto the page, possibly resulting in distorted colors.

Copyright © 2002 – 2019 YesLogic Pty. Ltd.
  • About Us
  • Privacy Policy
  • Contact Us