Pdf rotation: loss of quality.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
poincare999

Pdf rotation: loss of quality.

Post by poincare999 »

When I do

convert originalfile.pdf -rotate 90 finalfile.pdf

the final file has a poor quality.
How can I don't lose quality?

Tanks



ps: I have the same problem if I do

convert originalfile.pdf -rotate 90 finalfile.jpeg


pps: How can I load some files on this forum??
poincare999

Re: Pdf rotation: loss of quality.

Post by poincare999 »

I have resolved the problem with this command:

convert -density 300x300 originalfile.pdf -rotate90 finalfile.pdf


This following web page is much useful; ImageMagick is a fantastic program.
http://www.imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Pdf rotation: loss of quality.

Post by anthony »

Remember PDF is a vector image format. Im is a raster image processor.
See... A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
poincare999

Re: Pdf rotation: loss of quality.

Post by poincare999 »

Are scanned pdf_books raster or vector?

I thought that all scanned pdf_book are raster.


However, some my scanned pdf_book surely are raster, because I have scanned them in jpeg format, and after I have converted them in pdf with IM.
But some other books that I own, was scanned from other people, and I don't know if they are raster or vector.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Pdf rotation: loss of quality.

Post by anthony »

You did not mention that the PDF was of scaned books. At least not in this thread.

That means the PDF would contain (somehow) a raster image, rather than text that can be rendered in terms of vectors. This mean that the rasters will be stored at one particular resolution (density) and unless IM renders them at that resolution the image will be resized and thus degraded.

The ideal solution would thus be either to rotate the PDF as PDF leaving the data as is, or somehow extract the stored raster image as is without ghostscript re-drawing it at some other resolution.

pps: How can I load some files on this forum?
You place the files somewhere on the web, and point to them.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply