render

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 39 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package render turns selected .pptx slides into PNG images using a Puppt-owned Open XML interpretation path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(ctx context.Context, inputPath string, options Options) (model.CommandResult, error)

func SlideCount

func SlideCount(ctx context.Context, inputPath string) (int, error)

Types

type ObjectDebugOptions

type ObjectDebugOptions struct {
	Mode              ObjectDebugRenderMode
	TargetZOrder      int
	HasFlatBackground bool
	FlatBackground    color.RGBA
	ArtifactDir       string
	Records           []PaintedObject
	// contains filtered or unexported fields
}

type ObjectDebugRenderMode

type ObjectDebugRenderMode string
const (
	ObjectDebugRenderNormal     ObjectDebugRenderMode = ""
	ObjectDebugRenderBefore     ObjectDebugRenderMode = "before"
	ObjectDebugRenderObjectOnly ObjectDebugRenderMode = "object"
	ObjectDebugRenderThrough    ObjectDebugRenderMode = "through"
)

type ObjectEMUPointBounds

type ObjectEMUPointBounds struct {
	X  int64 `json:"x"`
	Y  int64 `json:"y"`
	CX int64 `json:"cx"`
	CY int64 `json:"cy"`
}

type ObjectFloatBounds

type ObjectFloatBounds struct {
	MinX float64 `json:"min_x"`
	MinY float64 `json:"min_y"`
	MaxX float64 `json:"max_x"`
	MaxY float64 `json:"max_y"`
}

type ObjectFloatPoint

type ObjectFloatPoint struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

type ObjectPixelBounds

type ObjectPixelBounds struct {
	MinX int `json:"min_x"`
	MinY int `json:"min_y"`
	MaxX int `json:"max_x"`
	MaxY int `json:"max_y"`
}

type ObjectStyleSummary

type ObjectStyleSummary struct {
	Geometry                string             `json:"geometry,omitempty"`
	CustomPathPoints        int                `json:"custom_path_points,omitempty"`
	CustomPathCoordinates   []ObjectFloatPoint `json:"custom_path_coordinates,omitempty"`
	CustomPathBounds        *ObjectFloatBounds `json:"custom_path_bounds,omitempty"`
	CustomPathCommands      int                `json:"custom_path_commands,omitempty"`
	CustomPathUnsupported   []string           `json:"custom_path_unsupported,omitempty"`
	Fill                    string             `json:"fill,omitempty"`
	PatternFill             string             `json:"pattern_fill,omitempty"`
	Line                    string             `json:"line,omitempty"`
	Text                    string             `json:"text,omitempty"`
	FontFamily              string             `json:"font_family,omitempty"`
	FontFamilies            []string           `json:"font_families,omitempty"`
	FontSize                int                `json:"font_size,omitempty"`
	ParagraphFontSize       int                `json:"paragraph_font_size,omitempty"`
	Bold                    bool               `json:"bold,omitempty"`
	Italic                  bool               `json:"italic,omitempty"`
	TextColor               string             `json:"text_color,omitempty"`
	TextAlign               string             `json:"text_align,omitempty"`
	TextBox                 bool               `json:"text_box,omitempty"`
	TextBodyProperties      []string           `json:"text_body_properties,omitempty"`
	TextParagraphProperties []string           `json:"text_paragraph_properties,omitempty"`
	Description             string             `json:"description,omitempty"`
	Title                   string             `json:"title,omitempty"`
	CreationID              string             `json:"creation_id,omitempty"`
	NonVisualProperties     []string           `json:"non_visual_properties,omitempty"`
	NonVisualLocks          []string           `json:"non_visual_locks,omitempty"`
	Placeholder             string             `json:"placeholder,omitempty"`
	EmbedID                 string             `json:"embed_id,omitempty"`
	SVGEmbedID              string             `json:"svg_embed_id,omitempty"`
	Image                   string             `json:"image,omitempty"`
	ImageCrop               string             `json:"image_crop,omitempty"`
	ImageEffects            []string           `json:"image_effects,omitempty"`
	ImageUnsupported        []string           `json:"image_unsupported,omitempty"`
	EffectUnsupported       []string           `json:"effect_unsupported,omitempty"`
	Table                   bool               `json:"table,omitempty"`
	TableStyleID            string             `json:"table_style_id,omitempty"`
	TableProperties         []string           `json:"table_properties,omitempty"`
	TableColumnIDs          []string           `json:"table_column_ids,omitempty"`
	TableRowIDs             []string           `json:"table_row_ids,omitempty"`
	TableUnsupported        []string           `json:"table_unsupported,omitempty"`
	Shadow                  bool               `json:"shadow,omitempty"`
	ShadowColor             string             `json:"shadow_color,omitempty"`
	ShadowBlur              int64              `json:"shadow_blur_emu,omitempty"`
	ShadowDistance          int64              `json:"shadow_distance_emu,omitempty"`
	ShadowDirection         int64              `json:"shadow_direction,omitempty"`
	ShadowAlignment         string             `json:"shadow_alignment,omitempty"`
	ShadowScaleX            int64              `json:"shadow_scale_x,omitempty"`
	ShadowScaleY            int64              `json:"shadow_scale_y,omitempty"`
	ShadowSkewX             int64              `json:"shadow_skew_x,omitempty"`
	ShadowSkewY             int64              `json:"shadow_skew_y,omitempty"`
	GradientFill            bool               `json:"gradient_fill,omitempty"`
	NoFill                  bool               `json:"no_fill,omitempty"`
	NoLine                  bool               `json:"no_line,omitempty"`
}

type ObjectUnsupported

type ObjectUnsupported struct {
	Code    string `json:"code"`
	Part    string `json:"part,omitempty"`
	Message string `json:"message"`
}

type Options

type Options struct {
	SlideNumber int
	OutputPath  string
	DPI         int
	ObjectDebug *ObjectDebugOptions
}

type PaintedObject

type PaintedObject struct {
	SlidePart           string               `json:"slide_part"`
	SourcePart          string               `json:"source_part"`
	XMLPath             string               `json:"xml_path,omitempty"`
	CNvPrID             string               `json:"cnv_pr_id,omitempty"`
	CNvPrName           string               `json:"cnv_pr_name,omitempty"`
	CNvPrDescription    string               `json:"cnv_pr_description,omitempty"`
	CNvPrTitle          string               `json:"cnv_pr_title,omitempty"`
	CNvPrCreationID     string               `json:"cnv_pr_creation_id,omitempty"`
	Kind                string               `json:"kind"`
	ZOrder              int                  `json:"z_order"`
	Bounds              ObjectEMUPointBounds `json:"bounds_emu,omitempty"`
	ResolvedStyle       ObjectStyleSummary   `json:"resolved_style"`
	PixelBounds         ObjectPixelBounds    `json:"pixel_bounds,omitempty"`
	FractionalBounds    ObjectFloatBounds    `json:"fractional_pixel_bounds,omitempty"`
	OutputPixelBounds   *ObjectPixelBounds   `json:"output_pixel_bounds,omitempty"`
	BeforeArtifactPath  string               `json:"before_artifact_path,omitempty"`
	ObjectArtifactPath  string               `json:"object_artifact_path,omitempty"`
	ThroughArtifactPath string               `json:"through_artifact_path,omitempty"`
	Unsupported         []ObjectUnsupported  `json:"unsupported,omitempty"`
	Painted             bool                 `json:"painted"`
}

Jump to

Keyboard shortcuts

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