Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongly oriented image files generated from landscape PDFs #86

Open
holdenhao opened this issue Sep 15, 2021 · 0 comments
Open

Wrongly oriented image files generated from landscape PDFs #86

holdenhao opened this issue Sep 15, 2021 · 0 comments

Comments

@holdenhao
Copy link

I have a PDF file exported from Powerpoint that c.documentviewer wrongly converts to images in portrait mode. The pages of the source PDF are all in landscape.

My fix for this issue was to change the order of the GM options in converter.py:

from:

                cmd = [
                    self.binary, "convert",
                    '-resize', str(size[1]) + 'x',
                    '-density', '150',
                    '-format', format,
                    filename, output_file] 

to:

                cmd = [
                    self.binary, "convert",
                    filename,
                    '-resize', str(size[1]) + 'x',
                    '-density', '150',
                    '-format', format,
                    output_file]

The gm documentation states:

gm convert [ options ... ] input_file [ options ... ] output_file

so encoder options are better added after the input_file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant