public static void main(String[] args) throws FileNotFoundException, DocumentException {
		File[] pdfs = new File("./input").listFiles();
		PDFUtil pdfUtil = null;
		for (File file : pdfs) {
			if (file.getName().endsWith("pdf")) {
				pdfUtil = new PDFUtil(file);
				
				while (pdfUtil.goToNextPage()) {
					String recordFirstPage, recordSecondPage = "";
					recordFirstPage = pdfUtil.getCurrentPageContent();
					if (recordFirstPage.contains("MLS")) {
						pdfUtil.goToNextPage();
						recordSecondPage = pdfUtil.getCurrentPageContent();
					} else
						continue;
					
					RecordModel record = new RecordModel(recordFirstPage + "\n" + recordSecondPage);
					record.extract();
					if(record.getMlsNumber().isEmpty())
						continue;
					try {
//						String tmpFileName = "./output/" + file.getName() + ".txt";
						
						String pdfname = "";
						pdfname =  "./outpdf/" + record.getMlsNumber()+".pdf";
						try {
							
							record.toPdf(pdfname);
							
							
						} catch (DocumentException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
//						String existString = FileUtil.readFile(tmpFileName, "UTF-8");
//						if (!existString.equals(""))
//							FileUtil.writeFile(existString + "\n" + record.toString(), tmpFileName, "UTF-8");
//						else
//							FileUtil.writeFile(record.toString(), tmpFileName, "UTF-8");
					} catch (FileNotFoundException e) {
						Log.logError(e);
					} catch (IOException e) {
						Log.logError(e);
					}
					Log.logInfo("成功提取记录, MLS为" + record.getMlsNumber());
					Log.logInfo(record.toLogString());
				}
				
			}
		}

	}