title
};
String titleURL = Encoder.encodeTitleLocalUrl(title);
User user = new User("", "", "http://en.wikipedia.org/w/api.php");
user.login();
WikiDB db = null;
String mainDirectory = "c:/temp/";
// the following subdirectory should not exist if you would like to create a
// new database
String databaseSubdirectory = "WikiDB";
// the following directory must exist for image downloads
String imageDirectory = "c:/temp/WikiImages";
try {
db = new WikiDB(mainDirectory, databaseSubdirectory);
APIWikiModel myWikiModel = new APIWikiModel(user, db, "${image}", "file:///c:/temp/${title}", imageDirectory);
DocumentCreator creator = new DocumentCreator(myWikiModel, user, listOfTitleStrings);
creator.renderPDFToFile(mainDirectory, titleURL + ".pdf", HTMLConstants.CSS_PRINTER_STYLE);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (db != null) {
try {
db.tearDown();
} catch (Exception e) {
e.printStackTrace();
}
}
}