here i am describing how I have used multivalent
help link: http://multivalent.sourceforge.net/Tools/pdf/Compress.html
download link: http://sourceforge.net/project/showfiles.php?group_id=44509
to install:
1. place the attached jar file to anywhere in server
2. in terminal ype: sudo vi /etc/environment this will open a file something like this:
PATH=”/usr/local/sbin:/usr/
LANG=”en_US.UTF-8″
CLASSPATH=”:/home/tareq/projects/itext/iText-2.1.3.jar:/home/tareq/projects/itext/Multivalent20060102.jar:”
add the class path like the example here this /home/tareq/projects/itext/ path can be anywhere
3. restart the server
4. now run the python script placing it to the correct place or you can test in terminal just type java tool.pdf.Compress path_to_pdf_file
hope this works