Documentation ¶
Index ¶
Constants ¶
View Source
const ( EMUS_PER_INCH = 914400 DEFAULT_DPI = 72 )
Variables ¶
View Source
var JPEG_CONTENT_TYPE = Default{Extension: "jpeg", ContentType: "image/jpeg"}
View Source
var JPG_CONTENT_TYPE = Default{Extension: "jpg", ContentType: "image/jpg"}
View Source
var PNG_CONTENT_TYPE = Default{Extension: "png", ContentType: "image/png"}
Functions ¶
This section is empty.
Types ¶
type ContentTypes ¶ added in v0.4.0
type DocxTmpl ¶
type DocxTmpl struct { *docx.Docx // contains filtered or unexported fields }
func Parse ¶
Parse the document from a reader and store it in memory. You can it invoke from a file.
reader, err := os.Open(FILE_PATH) if err != nil { panic(err) } fileinfo, err := reader.Stat() if err != nil { panic(err) } size := fileinfo.Size() doc, err := docxtpl.Parse(reader, int64(size))
func ParseFromFilename ¶ added in v0.5.0
Parse the document from a filename and store it in memory.
func (*DocxTmpl) CreateInlineImage ¶ added in v0.3.0
func (d *DocxTmpl) CreateInlineImage(filepath string) (*InlineImage, error)
func (*DocxTmpl) RegisterFunction ¶ added in v0.6.0
type InlineImage ¶
type InlineImage struct {
// contains filtered or unexported fields
}
func (*InlineImage) GetExifData ¶ added in v0.4.0
func (i *InlineImage) GetExifData() (map[string]imagemeta.TagInfo, error)
Return a map of EXIF data from the image.
func (*InlineImage) GetResolution ¶ added in v0.4.0
func (i *InlineImage) GetResolution() (wDpi int64, hDpi int64)
Get the resolution (DPI) of the image. It gets this from EXIF data and defaults to 72 if not found.
type InlineImageError ¶ added in v0.3.0
type InlineImageError struct {
Message string
}
func (*InlineImageError) Error ¶ added in v0.3.0
func (e *InlineImageError) Error() string
Click to show internal directories.
Click to hide internal directories.