public static void main(String args[]) {
		try {
			t = PdfUtilities.chooseFolder();
			// TODO: create a method which tests if the file is an
			// ok-to-the-end-PDF to work with
			if (t != null) {
				ArrayList<File> files = PdfUtilities.getPaths(new File(t),
						new ArrayList<File>());
				if (files != null) {
					for (int i = 0; i < files.size(); i++) {
						if (!files.get(i).isDirectory() && files.get(i) != null) {
							try {
								System.out.println(files.get(i)
										.getCanonicalPath());
						if (PdfUtilities.testPdfOk(files.get(i))) {								
										PDDocument testfile = PDDocument
												.load(files.get(i));
									
											// to create new file eliminate the
											// ".pdf"-extension
											int lenOld = files.get(i)
													.toString().length();
											int lenNew = lenOld - 4;
											 newFileName = (files.get(i)
													.toString().substring(0,
													lenNew));											 
											convertToJpegPages(testfile);								
										}								
								}
							 catch (IOException e) {
								System.out.println(e);
							}
						}
					}
				}
			}
		} catch (IOException e) {
			System.out.println(e);
		}
	}