HomeUniDoc
...

Package render

Overview ▾

type ImageDevice

ImageDevice is used to render PDF pages to image targets.

type ImageDevice struct {

    // OutputWidth represents the width of the rendered images in pixels.
    // The heights of the output images are calculated based on the selected
    // width and the original height of each rendered page.
    OutputWidth int
    // contains filtered or unexported fields
}

func NewImageDevice

func NewImageDevice() *ImageDevice

NewImageDevice returns a new image device.

func (*ImageDevice) Render

func (d *ImageDevice) Render(page *model.PdfPage) (image.Image, error)

Render converts the specified PDF page into an image and returns the result.

func (*ImageDevice) RenderToPath

func (d *ImageDevice) RenderToPath(page *model.PdfPage, outputPath string) error

RenderToPath converts the specified PDF page into an image and saves the result at the specified location.

Subdirectories

Name Synopsis
..