Posts

Showing posts from August, 2019

Downloading Images Through PDFBox

RetrieveAndDownloadImages.java package com.hari.main.imageretrieve; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.axiom.om.util.Base64; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocumentCatalog; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.common.PDRectangle; import com.kwiktag.webservices.util.XmlUtil; import com.kwiktag.webservices.util.kwiktagUtils; import com.necho.platform.service.receiptretriever.ReceiptRetriever; import com.necho.platform.service.receiptupload.PDFDocumentHelper; import com.necho.platform.service.receiptupload.TIFFBilevelVerifierImpl; import com.necho.platform.service.receiptupload.TIFFInfoVO; import com.necho.platform.service.receiptupload.TIFFVerifier; public class RetrieveAndDownloadImages...

Reading And Writing Image Files using Java

GenerateOutputFileName.java --------------------------------------- import java.io.File; import java.io.IOException; import java.util.Date; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; public class GenerateOutputFileName { public static void main(String[] args) throws Exception{ File outputDirFile = new File("C:\\Users\\sivaleti\\Desktop\\Tmp"); String directoryName ="C:\\Users\\sivaleti\\Downloads\\Images\\"; String generatedFileDir ="C:\\Users\\sivaleti\\Desktop\\FTP1\\"; File folder = new File(directoryName); File[] listOfFiles = folder.listFiles(); System.out.println("Start :" + new Date()); for (int i = 0; i < listOfFiles.length; i++) { try { String fileExtension = getFileExtension(listOfFiles[i]); if(fileExtension.length() > 3 || fileExtension.equalsIgnoreCase("svg")) continue; String documentNumber = "N00100011111" + (2190137+i+1);...