joboptions

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 10 Imported by: 0

README

Joboptions parser

PkgGoDev

Parses Adobe joboptions files.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dictionary

type Dictionary map[Literal]Value

Dictionary is a set of Values keyed by a literal.

type Literal

type Literal string

Literal is a special kind of value in a joboptions file that starts with a slash. F.ex. /AntiAliasGrayImages or /CalRGBProfile. They should be treated as identifiers rather than a free text value.

type Parameters

type Parameters map[string]Dictionary

Parameters is a collection of named dictionaries. This is the top level representation of a joboptions file.

Common dictionary names are "setdistillerparams" and "setpagedevice".

func Parse

func Parse(data []byte) (Parameters, error)

Parse a joboptions payload and return the parameter set.

type Value

type Value struct {
	Type       ValueType  `json:"type"`
	Array      []Value    `json:"array,omitempty"`
	Boolean    bool       `json:"boolean,omitempty"`
	Dictionary Dictionary `json:"dictionary,omitempty"`
	Float      float64    `json:"float,omitempty"`
	Integer    int        `json:"integer,omitempty"`
	String     string     `json:"string,omitempty"`
	// Literal is the kind of value in a joboptions file that starts with a
	// slash. F.ex. /AntiAliasGrayImages or /CalRGBProfile.
	Literal Literal `json:"literal,omitempty"`
	// Binary data is represented as a hex encoded string in a joboptions
	// file, this is the decoded version of that data.
	Binary []byte `json:"binary,omitempty"`
}

Value is used to represent the different types of values that can occur in a joboptions file. The actual concrete field (Array, Boolean, Float et.c.) will be populated based on the Type of the value.

func (Value) StringFromUTF16

func (v Value) StringFromUTF16() (string, error)

type ValueType

type ValueType int

ValueType is used to identify the different types of values that can exist in a joboptions file.

const (
	ValueString ValueType = iota
	ValueArray
	ValueBoolean
	ValueBinary
	ValueDictionary
	ValueFloat
	ValueInteger
	ValueLiteral
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL