This is an archived forum post. The information may be outdated. Contact us if you have any questions.

PDF having CSS AND IMAGE compatibility from HTML Files

kamal arora wrote on 2011-09-09:
i want to generate PDF having CSS and IMAGE compatibility from html files using perl , is it possible with pdfcrowd provided solutions.

Hoping for your kind reply.

Thank you
Kamal
support wrote on 2011-09-11:
Hi Kamal,

you can use the HTTP API - here is a perl example that converts google.com (don't forget to replace $username and $apikey with your credentials):
use LWP::UserAgent;
my $ua = new LWP::UserAgent;

my $response = $ua->post('http://pdfcrowd.com/api/pdf/convert/uri/',
                         { username => "$username",
                           key => "$apikey",
                           src => 'http://google.com' });


if ($response->is_success) {
    open (FILE, ">google_com.pdf");
    print FILE $response->content;
    close FILE;
}
else {
    die $response->content;
}


Refer to the HTML to PDF REST API Documentation for more details.