| Class | PDF::HTMLDoc |
| In: |
lib/htmldoc.rb
|
| Parent: | Object |
The wrapper class around HTMLDOC, providing methods for setting the options for the application and retriving the generate output either as a file, diretory or string.
| errors | [R] | The last error messages generate by the command. It’s a hash where they key represents the error number, and the value represents the error message. If the error number is zero, HTMLDOC was called with invalid parameters. Errors can happen even if generation succeeds, for example, if an image can’t be found in the course of the generation. | ||||||
| result | [R] |
The last result from the generation of the output file(s). It’s a
hash comprising three pairs:
|
Creates a blank HTMLDOC wrapper and passes it to a block. When the block finishes running, the generate method is automatically called. The result of generate is then passed back to the application.
Adds a page for generation. The page can be a URL beginning with either http:// or https://; a file, which will be verified for existence; or any text.
Invokes HTMLDOC and generates the output. If an output directory or file is provided, the method will return true or false to indicate completion. If no output directory or file is provided, it will return a string representing the entire output. Generate will raise a PDF::HTMLDocException if the program path can’t be found.
Sets an option for the wrapper. Only valid HTMLDOC options will be accepted. The name of the option is a symbol, but the value can be anything. Invalid options will throw an exception. To unset an option, use nil as the value. Options with negated counterparts, like :encryption, can be set using :no or :none as the value.