private void findVisualDifferences(int pageNum, PDFPage pagePDF1, PDFPage pagePDF2, File targetFolder)
    {
    	 try {
    		 	// convert the page in a image
    		 	BufferedImage pageImgPDF1 = PDFVisualiseDifference.convertPage(pagePDF1);
    		 	BufferedImage pageImgPDF2 = PDFVisualiseDifference.convertPage(pagePDF2);
           
	            // get the structure elements for this page
	            PDFPageHolder pdfPageHolder1 = pdfInfoHolder.getPDFStructure1().getPageHolder(pageNum - 1);
	            PDFPageHolder pdfPageHolder2 = pdfInfoHolder.getPDFStructure2().getPageHolder(pageNum - 1);
	
	            Set<PDFEntryHolder> entryHolders = new HashSet<PDFEntryHolder>(pdfPageHolder1.getElements());
	            entryHolders.addAll(pdfPageHolder2.getElements());
	
	            // compare both images only at those place where a entryholder says
	            comparePDFEntries(pageImgPDF1, pageImgPDF2, entryHolders, pageNum);
	
	            // check if a difference was found
	            pdfPageHolder1.checkDifference();
	            pdfPageHolder2.checkDifference();
	
	            // mark the found differences visual
	            if (targetFolder != null && (pdfPageHolder1.isDifferent() || pdfPageHolder2.isDifferent())) 
	            {
	            	// create a illustration which shows the differences
	                BufferedImage diffimg = pdfVisualiseDifference.visualiseDifferences(pageImgPDF1, pageImgPDF2, entryHolders);
	
	                // save the difference image if desired
	                String pathName = targetFolder + "/" + pdfInfoHolder.getFilename() + "_pdf/";
	                File dir = new File(pathName);
	                dir.mkdirs();
	                ImageIO.write(diffimg, "PNG", new File(pathName + "page_" + pageNum + ".png"));
	            }
         
			} catch (Exception e) {
				log.error(pdfInfoHolder.getFilename()+": "+e.getMessage(), e);
			}
    }