You can use the following function which converts a webpage URL to a PDF file on your computer:
public boolean webpageToPdfFile(String url, String pdfFilePath)
{
try
{
Client client = new Client("***", "***");
FileOutputStream fileStream = new FileOutputStream(pdfFilePath);
client.convertURI(url, fileStream);
fileStream.close();
return true;
}
catch(PdfcrowdError why) {
System.err.println(why.getMessage());
}
catch(IOException exc) {
// handle the exception
}
return false;
}