Documentation
¶
Index ¶
- Constants
- func Append(rs io.ReadSeeker, w io.Writer, imgs []io.Reader) error
- func Decode(r io.Reader) (image.Image, error)
- func DecodeAll(r io.Reader) ([]image.Image, error)
- func DecodeConfig(r io.Reader) (cfg image.Config, err error)
- func Encode(w io.Writer, imgs []image.Image, o *Options) error
- func EncodeFile(outFile string, imgFiles []string, o *Options) (err error)
- func EncodeReader(w io.Writer, r []io.Reader) error
- type Options
- type Reader
- func (r *Reader) Extract() ([]model.Image, error)
- func (r *Reader) ExtractImages() ([]image.Image, error)
- func (r *Reader) ExtractPage(pageNr int) (imgs []model.Image, err error)
- func (r *Reader) ExtractPageImages(pageNr int) (imgs []image.Image, err error)
- func (r *Reader) Next() bool
- func (r *Reader) PageCount() int
Constants ¶
const DefaultQuality = 75
DefaultQuality is the default quality encoding parameter.
Variables ¶
This section is empty.
Functions ¶
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a PDF first image without decoding the entire image.
func EncodeFile ¶
EncodeFile appends images to outFile which will be created if necessary.
Types ¶
type Options ¶
type Options struct {
Quality int
}
Options are the encoding parameters. Quality ranges from 1 to 100 inclusive, higher is better.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader struct represents a PDF reader that holds a *model.Context.
func NewReader ¶
func NewReader(rs io.ReadSeeker, conf *model.Configuration) (*Reader, error)
NewReader creates a new Reader from an io.ReadSeeker and a *model.Configuration. If conf is nil, model.NewDefaultConfiguration() will be used.
func (*Reader) ExtractImages ¶
ExtractImages extracts all images from the current page as []image.Image.
func (*Reader) ExtractPage ¶
ExtractPage extracts all images from the specified page as []model.Image.
func (*Reader) ExtractPageImages ¶
ExtractPageImages extracts all images from the specified page as []image.Image.