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() *ImageDevice
NewImageDevice returns a new image device.
func (d *ImageDevice) Render(page *model.PdfPage) (image.Image, error)
Render converts the specified PDF page into an image and returns the result.
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.
Name | Synopsis |
---|---|
.. |