Skip to content

Indexed colour space not completely conforming #75

Open

Description

@MilkFather

Excerpt from PDF 1.7 (ISO 32000:2008) specification from Adobe:

8.6.6.3 Indexed Colour Spaces

An Indexed colour space shall be defined by a four-element array:

[/Indexed base hival lookup]

...(omitted)...

The base parameter shall be an array or name that identifies...

The current API in ColorSpace<'a> only allows the base parameter to be a name (source) and does not allow an array.

As a result, I cannot specify CalRGB, CalGray, IccBased or similar colour spaces as the base colour space, all of whom require an array to describe them.

Is it possible to extend the API to handle the array case, or is there a workaround?

Activity

  1. laurmaedje commented on Jan 21, 2026

    @laurmaedje
    Member

    Unfortunately pdf-writer currently does not always expose all options. The current API design (which needs to statically decide between parameter and writer return type) is not perfect and makes it at times annoying to expose such things.

    As for a workaround: Most writers allow you to drop down to the untyped API and write the underlying primitives directly. You could give that a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions