i developed application which will converts tiff,jpeg,pdfs in a zip file to single pdf,and its working fine and size is also similar to original files , but i need to compress the pdf ( save my file server memory) i searched in google , i got ghost script which will reduce the size of 5mb pdf to 50kb,and i manually executed same in linux and its working fine,but i want to run same command in java programme, but i dont know how to run linux command in java programme since i am new to java i am facing difficulties,can any one post sample programme how to run linux commands in java ,so i can try myself
-
possible duplicate of Java execute command line programColin D– Colin D2014-12-30 18:32:21 +00:00Commented Dec 30, 2014 at 18:32
-
Sounds like premature optimization... 5MB is not a lot, whether it be working memory or storage size.Brendan Lesniak– Brendan Lesniak2014-12-30 18:32:45 +00:00Commented Dec 30, 2014 at 18:32
-
Have you tried using compression options which are already in java such as gzip or any of options in the apache commons-compress library? docs.oracle.com/javase/8/docs/api/java/util/zip/… commons.apache.org/proper/commons-compressBrett Okken– Brett Okken2014-12-30 18:35:07 +00:00Commented Dec 30, 2014 at 18:35
-
Around 4lakhs users will use this application.space will be(4lakh*5mb)..thats yMahesh– Mahesh2014-12-30 18:36:46 +00:00Commented Dec 30, 2014 at 18:36
-
You couldnt have possibly googled for the answer to this question because it is a very easy answer to find if you actually did google for it. This is a duplicate; thanks Colin D.searchengine27– searchengine272014-12-30 18:39:28 +00:00Commented Dec 30, 2014 at 18:39
Add a comment
|
1 Answer
What you want to do should be able to be achieved by simply running a bash script, which is pretty simple. Also it happens that someone has asked that question before so that answer should in turn answer yours. Please let me know if you want a more detailed response or need help with the implementation.