Mxpress::PDF::Mechanize - Take a screenshot and add it to the pdf
Version 0.01
This is a quick example of how to expand Mxpress::PDF...
use Mxpress::PDF; use Mxpress::PDF::Mechanize; my $file = Mxpress::PDF->new_file($file_name, plugins => [qw/screenshot/] ); my $url = 'https://www.gohawaii.com/trip-planning'; $file->screenshot->add($url, %screenshot_args); $file->save;
This extends Mxpress::PDF currently with a single plugin 'screenshot'. tbc
Returns a new Mxpress::PDF::Plugin::Mechanize::Screenshot Object. This object is for assisting with mechanizing browser screenshots..
my $page = Mxpress::PDF->page(%page_args);
Mxpress::PDF::Plugin::Mechanize::Screenshot extends Mxpress::PDF::Plugin::Image and is for taking screenshots and adding them to a Mxpress::PDF::Page.
You can pass default attributes when instantiating the file object.
Mxpress::PDF->add_file($filename, screenshot => { %screenshot_attrs }, );
or when calling the objects add method.
$file->screenshot->add( %screenshot_attrs ); my $screenshot = $file->screenshot;
The following attributes can be configured for a Mxpress::PDF::Plugin::Screenshot object, they are all optional.
$screenshot->$attrs();
Mechanize class - WWW::Mechanize::Chrome
$screenshot->mech_class
Args that are passed to $mech_class->new;
$screenshot->mech_open_args
The Instantiated mech_class
$screenshot->mech->$methods
Select the node wrapper.
$screenshot->selector('#my-id');
Execute some JS.
$screenshot->js($js_string);
Sleep while the JS does it's thing.
$screenshot->sleep;
Scaling the screenshot
$screenshot->screenshot_scale;
Set a left offset before taking the screenshot.
$screenshot->screenshot_left_offset
Set a top offset before taking the screenshot.
$screenshot->screenshot->top_offset;
The width of the image added to the pdf.
$img->width($pt);
The height of the image added to the pdf.
$img->height($pt);
Align the image - fill|left|center|right
$img->align('right');
LNATION, <thisusedtobeanemail at gmail.com>
<thisusedtobeanemail at gmail.com>
Please report any bugs or feature requests to bug-mxpress-pdf-mechanize at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mxpress-PDF-Mechanize. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-mxpress-pdf-mechanize at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Mxpress::PDF::Mechanize
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Mxpress-PDF-Mechanize
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Mxpress-PDF-Mechanize
CPAN Ratings
https://cpanratings.perl.org/d/Mxpress-PDF-Mechanize
Search CPAN
https://metacpan.org/release/Mxpress-PDF-Mechanize
This software is Copyright (c) 2020 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Mxpress::PDF::Mechanize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mxpress::PDF::Mechanize
CPAN shell
perl -MCPAN -e shell install Mxpress::PDF::Mechanize
For more information on module installation, please visit the detailed CPAN module installation guide.