Hi All,
I'm trying to loop through and open PDFs in a folder using Java. I have the following code:
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
public class OpenPDFs {
public static void main(String[] args) throws IOException {
// TODO code application logic here
String fp;
fp ="S:\\Economic Forecasts\\Fcst13\\SourceForecasts\\";
File file = new File(fp);
if(file.toString().endsWith(".pdf"))
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + file);
else{
Desktop dt = Desktop.getDesktop();
dt.open(file);
}
}
}
which only opens the folder window that contains the files. In the end, what I've been tasked to do is go through a lot of PDFs and remove the metadata within each one. I know I can do this using Acrobat 9 but it can only be done 1 at a time. The people asking me about this say they have about 1000 PDFs to do this to. Has anyone ever done this or can you suggest a good way to do this?