Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToPdf ¶
ConvertToPdf converts document to PDF file. This package is beta, breaking changes can take place.
func ConvertToPdfWithOptions ¶
ConvertToPdfWithOptions convert the document to PDF with given options.
func RegisterFont ¶
RegisterFont makes a PdfFont accessible for using in converting to PDF.
func RegisterFontsFromDirectory ¶
RegisterFontsFromDirectory registers all fonts from the given directory automatically detecting font families and styles. For composite fonts use RegisterCompositeFontsFromDirectory.
Types ¶
type FontStyle ¶
FontStyle represents a kind of font styling. It can be FontStyle_Regular, FontStyle_Bold, FontStyle_Italic and FontStyle_BoldItalic.
type Options ¶
type Options struct {
// ProcessFields process the document fields if set to true, default is `false`.
ProcessFields bool
// EnableFontSubsetting process document with subsetting font to reduce size result.
// Default value is `true`.
EnableFontSubsetting bool
// FontFiles location of fonts for convert process.
FontFiles []string
// FontDirectory location of font directory for convert process.
// This will load all font files inside directory if set
// we recommend to use FontFiles for better performance.
FontDirectory string
// DefaultPageSize is applied when there is no page size explicitly set in the document.
// A4 is the default option.
DefaultPageSize _ggg.PageSize
// DefaultFontSize is applied when there is no font size explicitly set in the document
// Possible values compatible with MS Word are 11 or 12, by default it is 12.
DefaultFontSize int
// RtlFontFile is applied for RTL paragraphs. Only one font is currently supported
// for RTL paragraphs within one document.
RtlFontFile string
// DefaultImageEncoder sets the default image encoder for the convert process.
// Default value is nil, which will use the best suitable encoder based on image format.
// If image is `jpg` or `jpeg` will use `DCTEncoder` if image is `png` or in other format will use `FlateEncoder`.
// Available options are `FlateEncoder`, `DCTEncoder`, `LZWEncoder`, `JBIG2Encoder`, `CCITTFaxEncoder`, and `RawEncoder`.
DefaultImageEncoder _ab.StreamEncoder
}
Options contains the options for convert process - e.g ProcessFields is when document contains fields and the value need to be processed also.