keeping same orientation using -define pdf:fit-page=548x

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
henryoswald
Posts: 5
Joined: 2014-02-24T06:03:38-07:00
Authentication code: 6789

keeping same orientation using -define pdf:fit-page=548x

Post by henryoswald »

Hi,

I am using the new "convert -define pdf:fit-page=548x" which was kindly added in 7.8.8-8 (1)

When I run the following command against a landscape image it auto converts it to portrait

Code: Select all

convert -density 300 -define pdf:fit-page=548x poster.pdf[0] -resize 548x poster.png
i've tried -auto-orient but that did not help. Is there an option to enforce that the same orientation is kept during the conversion process?

Thanks in advance.

1 - viewtopic.php?f=1&t=25075
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: keeping same orientation using -define pdf:fit-page=548x

Post by fmw42 »

7.8.8-8
There is no such version. Do you mean 6.8.8.8 beta? 6.8.8.7 is the current release and that does not include this feature.


Perhaps you could post a link to your pdf file or an example one that shows this issue. You can upload to dropbox.com (public folder) and put a link here.

I cannot duplicate your problem using IM 6.8.8.8 beta Q16 Mac OSX using

Code: Select all

convert logo: logo.pdf
im6888beta convert -density 300 -define pdf:fit-page=548x logo.pdf -resize 548x logo_tmp.png
The result is still landscape.

Perhaps there is some other information in your PDF that makes it re-orient to portrait.


What version of IM are you using and what platform?
henryoswald
Posts: 5
Joined: 2014-02-24T06:03:38-07:00
Authentication code: 6789

Re: keeping same orientation using -define pdf:fit-page=548x

Post by henryoswald »

You are correct, I ment 6.8.8-8 which I built from source running on ubuntu server 12.04

Here is a file which coverts to portrait https://dl.dropboxusercontent.com/u/2333308/poster.pdf

when converting without "-define pdf:fit-page=548x" the orientation is kept the same.

Advice is very welcome.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: keeping same orientation using -define pdf:fit-page=548x

Post by dlemstra »

It looks like there is an extra option that forces Ghostscript to not change the orientation. I will look into it.

That option does not work... I did however manage to fix it. Since you are building from source you should change -dPDFFitPage to -dPSFitPage on line 648 of coders\pdf.c
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply