docx2pdf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 10 Imported by: 0

README

docx2pdf

A high-performance, native Golang library for converting DOCX to PDF without external dependencies like LibreOffice. Designed for speed, accuracy, and full control over document layout.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBytes

func ConvertBytes(inputBytes []byte) ([]byte, error)

Types

type Document

type Document struct {
	Paragraphs []Paragraph `xml:"body>p"`
	Tables     []Table     `xml:"body>tbl"`
	Drawings   []Drawing   `xml:"body>drawing"`
}

type Drawing

type Drawing struct {
	Image ImageRef `xml:"inline>graphic>graphicData>pic:pic>blipFill>blip"`
}

type ImageRef

type ImageRef struct {
	ID string `xml:"embed,attr"`
}

type Paragraph

type Paragraph struct {
	Alignment string `xml:"pPr>jc"` // Align: left, right, center
	Runs      []Run  `xml:"r"`
}

type Run

type Run struct {
	Properties RunProperties `xml:"rPr"`
	Texts      []Text        `xml:"t"`
}

type RunProperties

type RunProperties struct {
	Bold      bool   `xml:"b"`
	Italic    bool   `xml:"i"`
	FontSize  string `xml:"sz"`
	FontColor string `xml:"color"`
}

type Table

type Table struct {
	Rows []TableRow `xml:"tr"`
}

type TableCell

type TableCell struct {
	Text string `xml:"p>r>t"`
}

type TableRow

type TableRow struct {
	Cells []TableCell `xml:"tc"`
}

type Text

type Text struct {
	Text string `xml:",chardata"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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