-3

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

5
  • possible duplicate of Java execute command line program Commented Dec 30, 2014 at 18:32
  • Sounds like premature optimization... 5MB is not a lot, whether it be working memory or storage size. Commented 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-compress Commented Dec 30, 2014 at 18:35
  • Around 4lakhs users will use this application.space will be(4lakh*5mb)..thats y Commented 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. Commented Dec 30, 2014 at 18:39

1 Answer 1

2

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.

Running a bash shell script in java

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.