Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html to pdf is not working #76

Open
bsshetty17 opened this issue Nov 7, 2023 · 0 comments
Open

html to pdf is not working #76

bsshetty17 opened this issue Nov 7, 2023 · 0 comments

Comments

@bsshetty17
Copy link

chrome version: 118.0.5993.70
When i try to run example test script to convert html to pdf using debug mode, I see that my script hangs trying to make ws connection to browser.
I also observed that after chrome is spawned, i do not see a debug message on "[[DevTools listening on ws://127.0.0.1:41035/devtools/browser/c7f18fa3-ce6d-4b1d-9872-8fc397d52817]]"

and spawn option websocket does not contain following option: '--remote-debugging-address=127.0.0.1',

following is my script:

#!perl -w
use strict;
use Log::Log4perl qw(:easy);
use WWW::Mechanize::Chrome;

my $url = shift @argv
or die "Usage: perl $0 \n";
Log::Log4perl->easy_init($TRACE);
my $mech = WWW::Mechanize::Chrome->new(
headless => 1, # otherwise, PDF printing will not work
);

print "Loading $url";
$mech->get($url);

my $fn= 'screen.pdf';
my $page_pdf = $mech->content_as_pdf(
filename => $fn,
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant