Documentation
¶
Overview ¶
Pages of a PDF rendered as images with poppler, each a file a message attaches as an image
Index ¶
- Constants
- func Count(info string) int
- func Failure(name, stderr string) error
- func Folder(base, pdf string) (string, error)
- func Header(head []byte) bool
- func Info(ctx context.Context, run Runner, path string) (int, error)
- func PageFile(dir, pdf string, page int) string
- func Range(spec string, total int) (int, int, error)
- func Render(ctx context.Context, run Runner, pdf string, first, last int, dir string, ...) ([]string, error)
- type Missing
- type Output
- type Runner
Constants ¶
const ( // Pages one attach of a PDF takes at most, the first ones when it names none MaxPages = 25 // Resolution the pages are rendered at, in dots per inch DPI = 150 // Longest one program reading or rendering the PDF may take Limit = 2 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func Failure ¶
Why poppler could not read the PDF of the name, from what it wrote, as a sentence that says what to do
func Folder ¶
A new folder for the pages of the PDF under the folder given, named for the PDF; the folders kept there longer than a week removed first
func Header ¶
Whether the bytes a file starts with hold the header of a PDF within the first kilobyte, where readers look for it
func Info ¶
How many pages the PDF at the path holds, read by pdfinfo; refused in words for a file that is no PDF, one locked with a password and one poppler can't read
func PageFile ¶
File a page is rendered into in the folder, named for the PDF and the page, which the label of the prompt shows the model
func Range ¶
First and last page of a PDF of the pages given that the words ask for, the first 25 for none; refused in words for a range that is none, one outside the PDF or one of more than 25 pages
func Render ¶
func Render(ctx context.Context, run Runner, pdf string, first, last int, dir string, done func(page int)) ([]string, error)
Renders the pages from first to last of the PDF into the folder at 150 dpi with pdftoppm, one at a time so each is told to done as it is ready, a page too large for a message rendered again at 4096 pixels on its long side; the files in page order
Types ¶
type Missing ¶
The programs of poppler this computer lacks to render the pages of a PDF, with the package of each manager that installs them