Documentation ¶
Overview ¶
This package defines the commands used in PDF content stream objects. They can be chained to build an arbitrary content (see `WriteOperations` and the higher level `Appearance` object). Reciprocally, they can be obtained from a content by parsing it, using for instance the 'parser' package.
Index ¶
- func WriteOperations(ops ...Operation) []byte
- type Fl
- type GradientComplex
- type GradientDirection
- type GradientLinear
- type GradientPointGray
- type GradientPointRGB
- type GradientRadial
- type GraphicState
- type GraphicStream
- func (ap GraphicStream) AddExtGState(newExtGState *model.GraphicState) model.ObjName
- func (ap *GraphicStream) AddPattern(newPattern model.Pattern) model.ObjName
- func (ap GraphicStream) AddShading(newShading *model.ShadingDict) model.ObjName
- func (ap *GraphicStream) AddXObject(obj model.XObject)
- func (ap *GraphicStream) AddXObjectDims(obj model.XObject, x, y, width, height Fl)
- func (ap GraphicStream) ApplyToPageObject(page *model.PageObject, compress bool)
- func (ap GraphicStream) ApplyToTilling(pattern *model.PatternTiling)
- func (ap *GraphicStream) BeginText()
- func (ap *GraphicStream) BeginVariableText()
- func (ap *GraphicStream) EndText()
- func (ap *GraphicStream) EndVariableText()
- func (ap *GraphicStream) FillLinearGradientRGB(from, to GradientPointRGB)
- func (ap *GraphicStream) FillRadialGradientRGB(from, to GradientPointRGB, radius Fl)
- func (ap *GraphicStream) MoveText(x, y Fl)
- func (ap *GraphicStream) NewlineShowText(text string) error
- func (ap *GraphicStream) Ops(op ...Operation)
- func (ap *GraphicStream) RestoreState() error
- func (ap *GraphicStream) SaveState()
- func (ap *GraphicStream) SetAlphaMask(transparency *model.XObjectForm)
- func (app *GraphicStream) SetColorFill(c color.Color)
- func (app *GraphicStream) SetColorStroke(c color.Color)
- func (app *GraphicStream) SetFillAlpha(alpha Fl)
- func (ap *GraphicStream) SetFontAndSize(font fonts.BuiltFont, size Fl)
- func (app *GraphicStream) SetGraphicState(state *model.GraphicState)
- func (ap *GraphicStream) SetLeading(leading Fl)
- func (app *GraphicStream) SetStrokeAlpha(alpha Fl)
- func (ap *GraphicStream) SetTextMatrix(a, b, c, d, x, y Fl)
- func (app *GraphicStream) Shading(sh *model.ShadingDict)
- func (ap *GraphicStream) ShowText(text string) error
- func (ap GraphicStream) ToXFormObject(compress bool) *model.XObjectForm
- func (ap *GraphicStream) Transform(mat model.Matrix)
- type ImageColorSpace
- type ImageColorSpaceIndexed
- type ImageColorSpaceName
- type OpBeginIgnoreUndef
- type OpBeginImage
- type OpBeginMarkedContent
- type OpBeginText
- type OpClip
- type OpCloseEOFillStroke
- type OpCloseFillStroke
- type OpClosePath
- type OpCloseStroke
- type OpConcat
- type OpCubicTo
- type OpCurveTo
- type OpCurveTo1
- type OpEOClip
- type OpEOFill
- type OpEOFillStroke
- type OpEndIgnoreUndef
- type OpEndMarkedContent
- type OpEndPath
- type OpEndText
- type OpFill
- type OpFillStroke
- type OpLineTo
- type OpMarkPoint
- type OpMoveSetShowText
- type OpMoveShowText
- type OpMoveTo
- type OpRectangle
- type OpRestore
- type OpSave
- type OpSetCacheDevice
- type OpSetCharSpacing
- type OpSetCharWidth
- type OpSetDash
- type OpSetExtGState
- type OpSetFillCMYKColor
- type OpSetFillColor
- type OpSetFillColorN
- type OpSetFillColorSpace
- type OpSetFillGray
- type OpSetFillRGBColor
- type OpSetFlat
- type OpSetFont
- type OpSetHorizScaling
- type OpSetLineCap
- type OpSetLineJoin
- type OpSetLineWidth
- type OpSetMiterLimit
- type OpSetRenderingIntent
- type OpSetStrokeCMYKColor
- type OpSetStrokeColor
- type OpSetStrokeColorN
- type OpSetStrokeColorSpace
- type OpSetStrokeGray
- type OpSetStrokeRGBColor
- type OpSetTextLeading
- type OpSetTextMatrix
- type OpSetTextRender
- type OpSetTextRise
- type OpSetWordSpacing
- type OpShFill
- type OpShowSpaceGlyph
- type OpShowSpaceText
- type OpShowText
- type OpStroke
- type OpTextMove
- type OpTextMoveSet
- type OpTextNextLine
- type OpXObject
- type Operation
- type PropertyList
- type PropertyListDict
- type PropertyListName
- type RGB
- type RenderingDPI
- type RenderingDims
- type RenderingLength
- type RenderingSize
- type SpacedGlyph
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteOperations ¶
WriteOperations concatenate the given operations.
Types ¶
type Fl ¶
func ParseImage ¶
ParseImage supports importing JPEG, PNG, GIFF and TIFF images, according to the given MIME type. A dpi is returned: it's a default value (72) for JPG/JPEG images, and the one found in the image for PNG and GIFF.
func ParseImageFile ¶
func ParseImageFile(filename string) (*model.XObjectImage, Fl, error)
ParseImageFile read the image type from the file extension. See `ParseImage` for more details.
type GradientComplex ¶
type GradientComplex struct { Direction GradientDirection // required Offsets []Fl // between 0 and 1, should contain at least 2 elements Colors [][4]Fl // RGBA values, between 0 and 1 Reapeating bool }
GradientComplex supports multiple stops and opacities.
func (GradientComplex) BuildShadings ¶
func (gr GradientComplex) BuildShadings() (color, alpha *model.ShadingDict)
BuildShadings returns the shadings objects to use in a stream `alpha` may be nil if no opacity channel is needed.
type GradientDirection ¶
type GradientDirection interface {
// contains filtered or unexported methods
}
GradientDirection is either GradientRadial or GradientLinear
type GradientPointGray ¶
GradientPointGray defines the position and the gray color of a gradient step.
type GradientPointRGB ¶
GradientPointRGB defines the position and the (RGB) color of a gradient step.
type GraphicState ¶
type GraphicStream ¶
type GraphicStream struct { State GraphicState BoundingBox model.Rectangle // contains filtered or unexported fields }
GraphicStream is a buffer of graphics operation, with a state. It provides convenient methods to ease the creation of a content stream. Once ready, it can be transformed to an XObjectForm, a Page object or a Tilling pattern.
func NewGraphicStream ¶
func NewGraphicStream(bbox model.Rectangle) GraphicStream
NewGraphicStream setup the BBox and initialize the resources dictionary.
func (GraphicStream) AddExtGState ¶
func (ap GraphicStream) AddExtGState(newExtGState *model.GraphicState) model.ObjName
AddExtGState checks if the graphic state is in the resources map or generate a new name and adds the graphic state to the resources.
func (*GraphicStream) AddPattern ¶
func (ap *GraphicStream) AddPattern(newPattern model.Pattern) model.ObjName
AddPattern checks if the pattern is in the resources map or generate a new name and adds the pattern.
func (GraphicStream) AddShading ¶
func (ap GraphicStream) AddShading(newShading *model.ShadingDict) model.ObjName
AddShading checks is the shading is in the resources map or generates a new name and adds the shading.
func (*GraphicStream) AddXObject ¶
func (ap *GraphicStream) AddXObject(obj model.XObject)
AddXObject is the same as AddXObjectDims, but do not change the CTM.
func (*GraphicStream) AddXObjectDims ¶
func (ap *GraphicStream) AddXObjectDims(obj model.XObject, x, y, width, height Fl)
AddXObjectDims puts an image or an XObjectForm in the current page, at the given position, with the given dimentions. See `RenderingDims` for several ways of specifying image dimentions.
func (GraphicStream) ApplyToPageObject ¶
func (ap GraphicStream) ApplyToPageObject(page *model.PageObject, compress bool)
ApplyToPageObject update the given page with a single Content, build from the appearance. The content is optionaly compressed with the Flater filter.
func (GraphicStream) ApplyToTilling ¶
func (ap GraphicStream) ApplyToTilling(pattern *model.PatternTiling)
ApplyToTilling update the fields BBox, ContentStream and Resources of the given pattern.
func (*GraphicStream) BeginText ¶
func (ap *GraphicStream) BeginText()
BeginText starts the writing of text.
func (*GraphicStream) BeginVariableText ¶
func (ap *GraphicStream) BeginVariableText()
BeginVariableText starts a MarkedContent sequence of text
func (*GraphicStream) EndVariableText ¶
func (ap *GraphicStream) EndVariableText()
EndVariableText end a MarkedContent sequence of text
func (*GraphicStream) FillLinearGradientRGB ¶
func (ap *GraphicStream) FillLinearGradientRGB(from, to GradientPointRGB)
AddLinearGradientRGB builds a linear gradient shading dictionnary, and use it to fill the current path.
The vector's origin and destination are specified by the points `from` and `to`, expressed in user space units. In a linear gradient, blending occurs perpendicularly to this vector. Color 1 is used up to the origin of the vector and color 2 is used beyond the vector's end point. Between the points the colors are gradually blended.
func (*GraphicStream) FillRadialGradientRGB ¶
func (ap *GraphicStream) FillRadialGradientRGB(from, to GradientPointRGB, radius Fl)
AddRadialGradientRGB builds a radial gradient shading dictionnary, and use it to fill the current path.
Color 1 begins at the origin point specified by `from`. Color 2 begins at the circle specified by the center point `to` and `radius`. Colors are gradually blended from the origin to the circle. The origin and the circle's center do not necessarily have to coincide, but the origin must be within the circle to avoid rendering problems.
func (*GraphicStream) MoveText ¶
func (ap *GraphicStream) MoveText(x, y Fl)
MoveText moves to the start of the next line, offset from the start of the current line.
func (*GraphicStream) NewlineShowText ¶
func (ap *GraphicStream) NewlineShowText(text string) error
NewlineShowText moves to the next line and shows text.
func (*GraphicStream) Ops ¶
func (ap *GraphicStream) Ops(op ...Operation)
Ops adds one or more graphic command. Some commands usually need to also update the state: see the other methods.
func (*GraphicStream) RestoreState ¶
func (ap *GraphicStream) RestoreState() error
RestoreState restores the graphic state. An error is returned (only) if the calls of SaveState and RestoreState are not balanced.
func (*GraphicStream) SaveState ¶
func (ap *GraphicStream) SaveState()
Saves the graphic state. SaveState and RestoreState must be balanced.
func (*GraphicStream) SetAlphaMask ¶
func (ap *GraphicStream) SetAlphaMask(transparency *model.XObjectForm)
SetAlphaMask adds the given `transparency` content as an alpha mask in the graphic state.
func (*GraphicStream) SetColorFill ¶
func (app *GraphicStream) SetColorFill(c color.Color)
func (*GraphicStream) SetColorStroke ¶
func (app *GraphicStream) SetColorStroke(c color.Color)
func (*GraphicStream) SetFillAlpha ¶
func (app *GraphicStream) SetFillAlpha(alpha Fl)
func (*GraphicStream) SetFontAndSize ¶
func (ap *GraphicStream) SetFontAndSize(font fonts.BuiltFont, size Fl)
SetFontAndSize sets the font and the size (in points) for the subsequent text writing.
func (*GraphicStream) SetGraphicState ¶
func (app *GraphicStream) SetGraphicState(state *model.GraphicState)
SetGraphicState register the given state and write it on the stream
func (*GraphicStream) SetLeading ¶
func (ap *GraphicStream) SetLeading(leading Fl)
SetLeading sets the text leading parameter, which is measured in text space units. It specifies the vertical distance between the baselines of adjacent lines of text.
func (*GraphicStream) SetStrokeAlpha ¶
func (app *GraphicStream) SetStrokeAlpha(alpha Fl)
func (*GraphicStream) SetTextMatrix ¶
func (ap *GraphicStream) SetTextMatrix(a, b, c, d, x, y Fl)
SetTextMatrix changes the text matrix. This operation also initializes the current point position.
func (*GraphicStream) Shading ¶
func (app *GraphicStream) Shading(sh *model.ShadingDict)
Shading register the given shading and apply it on the stream. It is a shortcut for `AddShading` followed by `Ops(OpShFill)`.
func (*GraphicStream) ShowText ¶
func (ap *GraphicStream) ShowText(text string) error
ShowText shows the `text`, after encoding it according to the current font. And error is returned (only) if a font has not been setup. A typical text drawing should apply the following methods ;
- BeginText
- SetFontAndSize
- ShowText
- EndText
func (GraphicStream) ToXFormObject ¶
func (ap GraphicStream) ToXFormObject(compress bool) *model.XObjectForm
ToXFormObject write the appearance to a new object, and associate it the resources, which are shallow copied. The content is optionaly compressed with the Flater filter.
func (*GraphicStream) Transform ¶
func (ap *GraphicStream) Transform(mat model.Matrix)
Transform changes the current matrix, by applying a Concat Op with the given `mat` and updating the current state.
type ImageColorSpace ¶
type ImageColorSpace interface { Write() string // contains filtered or unexported methods }
ImageColorSpace is either:
- a device color space
- a limited form of Indexed colour space whose base colour space is a device space and whose colour table is specified by a byte string
- a name
type ImageColorSpaceIndexed ¶
type ImageColorSpaceIndexed struct { Base model.ColorSpaceName // required, must be a Device CS Lookup model.ColorTableBytes Hival uint8 }
ImageColorSpaceIndexed is written in PDF as [/Indexed base hival lookup ]
func (ImageColorSpaceIndexed) ToColorSpace ¶
func (c ImageColorSpaceIndexed) ToColorSpace() model.ColorSpace
func (ImageColorSpaceIndexed) Write ¶
func (c ImageColorSpaceIndexed) Write() string
type ImageColorSpaceName ¶
type ImageColorSpaceName struct {
model.ColorSpaceName
}
ImageColorSpaceName is a custom name or a device
func (ImageColorSpaceName) Write ¶
func (c ImageColorSpaceName) Write() string
type OpBeginImage ¶
type OpBeginImage struct { ColorSpace ImageColorSpace Image model.Image }
BI ... ID ... EI
func (OpBeginImage) Add ¶
func (o OpBeginImage) Add(out *bytes.Buffer)
func (OpBeginImage) Metrics ¶
func (img OpBeginImage) Metrics(res model.ResourcesColorSpace) (comps, bits int, err error)
Metrics returns the number of color components and the number of bits for each. An error is returned if the color space can't be resolved from the resources dictionary.
type OpBeginMarkedContent ¶
type OpBeginMarkedContent struct { Properties PropertyList Tag model.ObjName }
BMC or BDC depending on Properties
func (OpBeginMarkedContent) Add ¶
func (o OpBeginMarkedContent) Add(out *bytes.Buffer)
type OpBeginText ¶
type OpBeginText struct{}
BT
func (OpBeginText) Add ¶
func (o OpBeginText) Add(out *bytes.Buffer)
type OpCloseEOFillStroke ¶
type OpCloseEOFillStroke struct{}
b*
func (OpCloseEOFillStroke) Add ¶
func (o OpCloseEOFillStroke) Add(out *bytes.Buffer)
type OpCloseFillStroke ¶
type OpCloseFillStroke struct{}
b
func (OpCloseFillStroke) Add ¶
func (o OpCloseFillStroke) Add(out *bytes.Buffer)
type OpClosePath ¶
type OpClosePath struct{}
h
func (OpClosePath) Add ¶
func (o OpClosePath) Add(out *bytes.Buffer)
type OpCloseStroke ¶
type OpCloseStroke struct{}
s
func (OpCloseStroke) Add ¶
func (o OpCloseStroke) Add(out *bytes.Buffer)
type OpCubicTo ¶
type OpCubicTo struct {
// P1 et P2 are the control points
X1, Y1, X2, Y2, X3, Y3 Fl
}
c
type OpCurveTo1 ¶
type OpCurveTo1 struct {
// P2 is the control point
X2, Y2, X3, Y3 Fl
}
v
func (OpCurveTo1) Add ¶
func (o OpCurveTo1) Add(out *bytes.Buffer)
type OpEOFillStroke ¶
type OpEOFillStroke struct{}
B*
func (OpEOFillStroke) Add ¶
func (o OpEOFillStroke) Add(out *bytes.Buffer)
type OpEndIgnoreUndef ¶
type OpEndIgnoreUndef struct{}
func (OpEndIgnoreUndef) Add ¶
func (o OpEndIgnoreUndef) Add(out *bytes.Buffer)
type OpEndMarkedContent ¶
type OpEndMarkedContent struct{}
EMC
func (OpEndMarkedContent) Add ¶
func (o OpEndMarkedContent) Add(out *bytes.Buffer)
type OpFillStroke ¶
type OpFillStroke struct{}
B
func (OpFillStroke) Add ¶
func (o OpFillStroke) Add(out *bytes.Buffer)
type OpMarkPoint ¶
type OpMarkPoint struct { Properties PropertyList // optional Tag model.ObjName }
MP or DP depending on Properties
func (OpMarkPoint) Add ¶
func (o OpMarkPoint) Add(out *bytes.Buffer)
type OpMoveSetShowText ¶
\"
func (OpMoveSetShowText) Add ¶
func (o OpMoveSetShowText) Add(out *bytes.Buffer)
type OpMoveShowText ¶
type OpMoveShowText struct {
Text string // unescaped
}
'
func (OpMoveShowText) Add ¶
func (o OpMoveShowText) Add(out *bytes.Buffer)
type OpRectangle ¶
type OpRectangle struct {
X, Y, W, H Fl
}
re
func (OpRectangle) Add ¶
func (o OpRectangle) Add(out *bytes.Buffer)
type OpSetCacheDevice ¶
type OpSetCacheDevice struct {
WX, WY, LLX, LLY, URX, URY int // glyph units
}
d1
func (OpSetCacheDevice) Add ¶
func (o OpSetCacheDevice) Add(out *bytes.Buffer)
type OpSetCharSpacing ¶
type OpSetCharSpacing struct {
CharSpace Fl
}
Tc
func (OpSetCharSpacing) Add ¶
func (o OpSetCharSpacing) Add(out *bytes.Buffer)
type OpSetCharWidth ¶
type OpSetCharWidth struct {
WX, WY int // glyph units
}
d0
func (OpSetCharWidth) Add ¶
func (o OpSetCharWidth) Add(out *bytes.Buffer)
type OpSetFillCMYKColor ¶
type OpSetFillCMYKColor struct {
C, M, Y, K Fl
}
k
func (OpSetFillCMYKColor) Add ¶
func (o OpSetFillCMYKColor) Add(out *bytes.Buffer)
type OpSetFillColor ¶
type OpSetFillColor struct {
Color []Fl
}
sc
func (OpSetFillColor) Add ¶
func (o OpSetFillColor) Add(out *bytes.Buffer)
type OpSetFillColorN ¶
scn
func (OpSetFillColorN) Add ¶
func (o OpSetFillColorN) Add(out *bytes.Buffer)
type OpSetFillColorSpace ¶
type OpSetFillColorSpace OpSetStrokeColorSpace
cs
func (OpSetFillColorSpace) Add ¶
func (o OpSetFillColorSpace) Add(out *bytes.Buffer)
type OpSetFillGray ¶
type OpSetFillGray struct {
G Fl
}
g
func (OpSetFillGray) Add ¶
func (o OpSetFillGray) Add(out *bytes.Buffer)
type OpSetFillRGBColor ¶
type OpSetFillRGBColor struct {
R, G, B Fl
}
rg
func (OpSetFillRGBColor) Add ¶
func (o OpSetFillRGBColor) Add(out *bytes.Buffer)
type OpSetHorizScaling ¶
type OpSetHorizScaling struct {
Scale Fl
}
Tz
func (OpSetHorizScaling) Add ¶
func (o OpSetHorizScaling) Add(out *bytes.Buffer)
type OpSetLineCap ¶
type OpSetLineCap struct {
Style uint8
}
J
func (OpSetLineCap) Add ¶
func (o OpSetLineCap) Add(out *bytes.Buffer)
type OpSetLineJoin ¶
type OpSetLineJoin struct {
Style uint8
}
j
func (OpSetLineJoin) Add ¶
func (o OpSetLineJoin) Add(out *bytes.Buffer)
type OpSetLineWidth ¶
type OpSetLineWidth struct {
W Fl
}
w
func (OpSetLineWidth) Add ¶
func (o OpSetLineWidth) Add(out *bytes.Buffer)
type OpSetMiterLimit ¶
type OpSetMiterLimit struct {
Limit Fl
}
M
func (OpSetMiterLimit) Add ¶
func (o OpSetMiterLimit) Add(out *bytes.Buffer)
type OpSetRenderingIntent ¶
ri
func (OpSetRenderingIntent) Add ¶
func (o OpSetRenderingIntent) Add(out *bytes.Buffer)
type OpSetStrokeCMYKColor ¶
type OpSetStrokeCMYKColor OpSetFillCMYKColor
K
func (OpSetStrokeCMYKColor) Add ¶
func (o OpSetStrokeCMYKColor) Add(out *bytes.Buffer)
type OpSetStrokeColor ¶
type OpSetStrokeColor OpSetFillColor
SC
func (OpSetStrokeColor) Add ¶
func (o OpSetStrokeColor) Add(out *bytes.Buffer)
type OpSetStrokeColorN ¶
type OpSetStrokeColorN OpSetFillColorN
SCN
func (OpSetStrokeColorN) Add ¶
func (o OpSetStrokeColorN) Add(out *bytes.Buffer)
type OpSetStrokeColorSpace ¶
type OpSetStrokeColorSpace struct {
ColorSpace model.ColorSpaceName // either a ColorSpaceName, or a name of a resource
}
CS
func (OpSetStrokeColorSpace) Add ¶
func (o OpSetStrokeColorSpace) Add(out *bytes.Buffer)
type OpSetStrokeGray ¶
type OpSetStrokeGray OpSetFillGray
G
func (OpSetStrokeGray) Add ¶
func (o OpSetStrokeGray) Add(out *bytes.Buffer)
type OpSetStrokeRGBColor ¶
type OpSetStrokeRGBColor OpSetFillRGBColor
RG
func (OpSetStrokeRGBColor) Add ¶
func (o OpSetStrokeRGBColor) Add(out *bytes.Buffer)
type OpSetTextLeading ¶
type OpSetTextLeading struct {
L Fl
}
TL
func (OpSetTextLeading) Add ¶
func (o OpSetTextLeading) Add(out *bytes.Buffer)
type OpSetTextMatrix ¶
Tm
func (OpSetTextMatrix) Add ¶
func (o OpSetTextMatrix) Add(out *bytes.Buffer)
type OpSetTextRender ¶
type OpSetTextRender struct {
Render uint8
}
Tr
func (OpSetTextRender) Add ¶
func (o OpSetTextRender) Add(out *bytes.Buffer)
type OpSetTextRise ¶
type OpSetTextRise struct {
Rise Fl
}
Ts
func (OpSetTextRise) Add ¶
func (o OpSetTextRise) Add(out *bytes.Buffer)
type OpSetWordSpacing ¶
type OpSetWordSpacing struct {
WordSpace Fl
}
Tw
func (OpSetWordSpacing) Add ¶
func (o OpSetWordSpacing) Add(out *bytes.Buffer)
type OpShowSpaceGlyph ¶
type OpShowSpaceGlyph struct {
Glyphs []SpacedGlyph
}
TJ - OpShowSpaceGlyph is the same as OpShowSpaceText but with input specified as glyph number. This should be used in conjonction with a font using an identity encoding
func (OpShowSpaceGlyph) Add ¶
func (o OpShowSpaceGlyph) Add(out *bytes.Buffer)
type OpShowSpaceText ¶
type OpShowSpaceText struct { // Texts store a "normalized version" of texts and spaces // SpaceSubtractedAfter fields of 0 are ignored. Texts []pdfFonts.TextSpaced }
TJ - OpShowSpaceText enables font kerning
func (OpShowSpaceText) Add ¶
func (o OpShowSpaceText) Add(out *bytes.Buffer)
type OpShowText ¶
type OpShowText struct {
Text string // unescaped
}
Tj
func (OpShowText) Add ¶
func (o OpShowText) Add(out *bytes.Buffer)
type OpTextMove ¶
type OpTextMove struct {
X, Y Fl
}
Td
func (OpTextMove) Add ¶
func (o OpTextMove) Add(out *bytes.Buffer)
type OpTextMoveSet ¶
type OpTextMoveSet OpTextMove
TD
func (OpTextMoveSet) Add ¶
func (o OpTextMoveSet) Add(out *bytes.Buffer)
type OpTextNextLine ¶
type OpTextNextLine struct{}
T*
func (OpTextNextLine) Add ¶
func (o OpTextNextLine) Add(out *bytes.Buffer)
type Operation ¶
Operation is a command and its related arguments.
func RoundedRectPath ¶
RoundedRectPath returns a rectangle path with rounded corners. The rectangle is of width `w` and height `h`. Its upper left corner is positioned at point (`x`, `y`). The radius for each corner are given by `rTL` (top-left), `rTR` (top-right) `rBR` (bottom-right), `rBL` (bottom-left) (0 means square corners)
type PropertyList ¶
type PropertyList interface {
// contains filtered or unexported methods
}
PropertyList should be either a Name (refering to the resources dict) or dict object.
type PropertyListDict ¶
PropertyListDict is a dictionary, where indirect references and streams are not allowed.
type PropertyListName ¶
type RenderingDims ¶
type RenderingDims struct {
Width, Height RenderingSize // See EffectiveSize()
}
RenderingDims defines the size of an image in the page. PDF image objects don't contain such information, which are added via a tranformation matrix associated to the image.
func (RenderingDims) EffectiveSize ¶
func (r RenderingDims) EffectiveSize(img *model.XObjectImage) (width Fl, height Fl)
EffectiveSize performs automatic width and height calculation.
Only the width and height (in terms of columns and rows) of `img` are used.
If both `Width` and `Height` are nil, the image is rendered at 96 dpi. If either `Width` or `Height` is nil, it will be calculated from the other dimension so that the aspect ratio is maintained. Otherwise, `Width` or `Height` may be a dpi or a length.
type RenderingLength ¶
type RenderingLength Fl
RenderingLength specifies a length in user space units.
type RenderingSize ¶
type RenderingSize interface {
// contains filtered or unexported methods
}
RenderingSize is either RenderingDPI or RenderingLength.
type SpacedGlyph ¶
type SpacedGlyph struct { SpaceSubtractedBefore int GID uint32 // will be hex encoded in the content stream SpaceSubtractedAfter int }
TJ - OpShowSpaceGlyphs enables font kerning