Software to break a PDF file from the command line
We are looking for a Windows based software which, from a command line, burst a PDF file into the page or document.
Example, a PDF file containing 5 pages, with bookmark PAGE1, PAGE2, PAGE3, PAGE4 and PAGE5.
We would like the software via the command line (ie without interface) can generate PAGE1.pdf, PAGE2.pdf ...
Also, is it possible to highlight the index in a PDF to a text file?
Re: Software to break a PDF file from the command line
Nitro PDF Professional is the perfect PDF product for business and enterprise — combining the power to create, edit, organize, secure and convert PDF with an extremely competitive price. This software lets anyone easily create, combine, edit, secure, convert and collaborate with PDF files.
Nitro PDF Professional's key features:
- Create PDF files from more than 300 file types and use one-click functionality to quickly convert commonly-used file types such as Microsoft Word, Excel, PowerPoint, WordPerfect and more.
- Edit PDF content, no matter what it is. Fix typos, remove and change text. Perform advanced image editing tasks such as inserting, replacing, cropping, resizing and downsampling. Insert headers, footers, watermarks, numbering and more across multiple pages.
- Quickly convert PDF files for reuse in Microsoft Word, WordPerfect, OpenOffice and more.
- Control how people use the PDF files you share by encrypting them. Use passwords and digital certificates to limit who can open files and permissions to limit functionality such as printing, editing, copying and form filling. Use digital signatures and certification to make tamper-proof documents.
Re: Software to break a PDF file from the command line
Here is the code:
Code:
public static void parsePage1(String[][] tab)
throws IOException
{
Runtime myRuntime = Runtime.getRuntime();
Process myProcess;
File file = new File("C:\\" );
for(int i=0; i<tab.length; i++)
{
file = new File("SOURCE_PATH\\"+tab[i][0]+"_"+tab[i][1]+"_"+tab[i][2]+"_"+tab[i][3]+".pdf" );
myProcess = myRuntime.exec("java -jar \"C:\\Program Files\\pdfsam\\lib\\pdfsam-console-0.7.3.jar\" -f \""+file.getPath()+"\" -o DESTINATION_PATH -s BURST -compressed split" );
try
{
myProcess.waitFor();
}
catch (InterruptedException ie)
{
ie.printStackTrace();
}
file.delete();
file = new File("DESTINATION_PATH\\1_"+tab[i][0]+"_"+tab[i][1]+"_"+tab[i][2]+"_"+tab[i][3]+".pdf" );
file.renameTo(new File("DESTINATION_PATH\\"+tab[i][0]+"_"+tab[i][1]+"_"+tab[i][2]+"_"+tab[i][3]+".pdf" ));
file = new File("DESTINATION_PATH\\2_"+tab[i][0]+"_"+tab[i][1]+"_"+tab[i][2]+"_"+tab[i][3]+".pdf" );
file.delete();
myProcess.destroy();
}
}