LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2010, 02:22 PM   #1
Geriao
Member
 
Registered: Dec 2009
Distribution: Ubuntu Karmic Koala, Slackware 13.0
Posts: 66

Rep: Reputation: 17
Rotating a pdf file with convert loses resolution


I'm trying to rotate a whole pdf file 180 degrees using

Code:
convert original.pdf -rotate 180 final.pdf
But the resolution of final.pdf is quite bad, not like original.pdf's.

Is there a way to mantain the original resolution, or another tool that can do that? I use Slackware 13.0.

Thanks in advance!!
 
Old 03-16-2010, 03:46 PM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Try using:
http://www.accesspdf.com/pdftk/
 
Old 03-16-2010, 03:50 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Use mogrify instead ?
 
Old 03-16-2010, 06:14 PM   #4
Geriao
Member
 
Registered: Dec 2009
Distribution: Ubuntu Karmic Koala, Slackware 13.0
Posts: 66

Original Poster
Rep: Reputation: 17
I tried to compile pdftk, but I got this error, after lots of warnings:

Code:
gcjh --classpath="." Gnu;
Exception in thread "main" java.io.IOException: can't find class file
java_local/security/Provider.class in
java.net.URLClassLoader{urls=[file:/home/thales/downloads/builds/pdftk/pdftk-1.41/java_libs/gnu_local/java/security/provider/./,file:/usr/share/java/libgcj-4.3.3.jar],
parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
   at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.ClassWrapper.linkSupers(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.ClassWrapper.printFully(libgcj-tools.so.9)
   at
gnu.classpath.tools.javah.CniIncludePrinter.printClass(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.Main.writeHeaders(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.9)
   at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.9)
make[2]: *** [Gnu.h] Error 1
rm Gnu.class
make[2]: Leaving directory
`/home/thales/downloads/builds/pdftk/pdftk-1.41/java_libs/gnu_local/java/security/provider'
make[1]: *** [libgcj_local] Error 2
make[1]: Leaving directory
`/home/thales/downloads/builds
I couldn't figure out how to fix this. I use gcc/gcj 4.3.3, so I guess it would work fine.


And as I said I tried convert/mogify, but the resolution of the output is crappy...

Is there a way to make the resolution better? It would just fine to use convert...
 
Old 03-16-2010, 09:49 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
You didn't say you'd tried mogrify, and convert actually is designed to "convert" from one format to another. If you can find an option to preserve the resolution for convert then good luck. Maybe you would be better off converting the file to images then rotating each image, before making a pdf out of them.
 
Old 03-17-2010, 08:44 AM   #6
Geriao
Member
 
Registered: Dec 2009
Distribution: Ubuntu Karmic Koala, Slackware 13.0
Posts: 66

Original Poster
Rep: Reputation: 17
Actually mogrify is the same as convert. From mogrify's man page:

Quote:
Mogrify overwrites the original
image file, whereas, convert(1) writes to a different image file.
Maybe converting to images would be fine... If convert can indeed mantain the resolution... I still have to figure out if there's such an option (it should!).
 
Old 03-17-2010, 11:24 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Hmm, yeah, it looks like nobody's maintaining it anymore.

Well, here are some alternatives:
http://sourceforge.net/projects/jpdftweak/files/
http://sourceforge.net/projects/pdfshuffler/files/

I tested the first one and it works. The second one has some dependencies.
 
Old 03-17-2010, 02:43 PM   #8
Geriao
Member
 
Registered: Dec 2009
Distribution: Ubuntu Karmic Koala, Slackware 13.0
Posts: 66

Original Poster
Rep: Reputation: 17
I think you are right. I emailed the author of pdftk about this compile error a couple days ago, and didn't get an answer... That, and the gcc he recommends is version 3.5.2.

Anyway, I got convert to work properly... The correct option to use in convert/mogrify is '-density XXX'. The default is 72 (dpi), so all pdfs look like crap. I used:

convert -density 200 original.pdf -rotate 180 final.pdf

and it worked fine. Thanks everyone.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert an Image folder to a PDF file mauran Linux - Software 8 12-01-2012 09:24 AM
How to Convert Pct File into PDF alok_mits Linux - Software 1 07-10-2007 02:15 AM
Is there a way to convert a PDF file to another format? M$ISBS General 10 05-09-2007 01:43 AM
how to convert pdf file to doc format. thushara Linux - Newbie 3 03-22-2005 06:29 AM
Convert Open Office file to PDF file. liguorir Linux - Software 1 01-13-2004 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration