Hi,
I seem to run in to an issue when converting a pdf file that has pages in both portrait and landscape orientation. All pages are converted as portrait, so some pages are cut off.
This is the command i usually use:
nconvert -dpi 300 -out png -merge_alpha -o outputpath\out.png -xall
Is there a way to get the orientation right for each page?
Thanks in advance
Multipage PDF to PNG sometimes shows incomplete image
Moderators: XnTriq, helmut, xnview
-
- Posts: 4
- Joined: Tue Aug 08, 2017 1:03 pm
-
- XnThusiast
- Posts: 3830
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Multipage PDF to PNG maintaining mixed page orientation
I don't have a problem using this code with the attached test file I created:Anja wrote:I seem to run in to an issue when converting a pdf file that has pages in both portrait and landscape orientation. All pages are converted as portrait, so some pages are cut off.
This is the command i usually use:
Is there a way to get the orientation right for each page?Code: Select all
nconvert -dpi 300 -out png -merge_alpha -o outputpath\out.png -xall
Code: Select all
nconvert -dpi 300 -out png -merge_alpha -o test.png -xall *.pdf
You do not have the required permissions to view the files attached to this post.
-
- XnThusiast
- Posts: 3830
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Multipage PDF to PNG maintaining page orientations
Further:
Which version of NConvert are you using, and which version of Ghostscript do you have installed?
NConvert 32-bit requires Ghostscript 32-bit installed (even on 64-bit operating systems...).
Nconvert 64-bit requires Ghostscript 64-bit installed.
I have a vague recollection of a report of a possibly similar problem to the one you describe several years ago, when the wrong version of Ghostscript was installed...
Which version of NConvert are you using, and which version of Ghostscript do you have installed?
NConvert 32-bit requires Ghostscript 32-bit installed (even on 64-bit operating systems...).
Nconvert 64-bit requires Ghostscript 64-bit installed.
I have a vague recollection of a report of a possibly similar problem to the one you describe several years ago, when the wrong version of Ghostscript was installed...

-
- Posts: 4
- Joined: Tue Aug 08, 2017 1:03 pm
Re: Multipage PDF to PNG maintaining page orientations
https://send.firefox.com/download/f4875 ... 6V1s7Wx3MA
The file I have an issue with is just over the limit, I hope you can get it here.
I'm using the 32 bit version (v2.36) with Ghostscript 32 bit
The file I have an issue with is just over the limit, I hope you can get it here.
I'm using the 32 bit version (v2.36) with Ghostscript 32 bit
-
- XnThusiast
- Posts: 3830
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Multipage PDF to PNG maintaining page orientations
I can reproduce, your file opens normally in Adobe Acrobat, but when the pages are extracted using an NConvert script, only the left-half of landscape orientation pages is displayed...
Googling the GS error displayed for some pages "ERROR: -101" produces this hit:
[gs-bugs] [Bug 695848] New: Ghostscript decode error when opening PDF
You might like to Google the error code yourself, as the above bug report was only tentative.
I may be able to have another look later in the day, but if anyone has a solution it will probably be XnTriq much later today...
Googling the GS error displayed for some pages "ERROR: -101" produces this hit:
[gs-bugs] [Bug 695848] New: Ghostscript decode error when opening PDF
You might like to Google the error code yourself, as the above bug report was only tentative.
I may be able to have another look later in the day, but if anyone has a solution it will probably be XnTriq much later today...

-
- Moderator & Librarian
- Posts: 6228
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: Multipage PDF to PNG maintaining page orientations
I've found quite a few topics discussing the issue, …cday wrote:I have a vague recollection of a report of a possibly similar problem to the one you describe several years ago, when the wrong version of Ghostscript was installed...
… but as far ar I can tell, there's no solution.
-
- Posts: 4
- Joined: Tue Aug 08, 2017 1:03 pm
Re: Multipage PDF to PNG sometimes shows incomplete image
I seem to have run in to some other files which seem to suffer from the same issue.
In this case however, all the pages in the pdf do have the same orientation (landscape). When converting to png, the first one is ok, but all of the following pages are put in portrait, so almost half of the image is cut off. I'd add the file, but it's quite large.
So first one's a winner, get the file here:
https://send.firefox.com/download/4955b ... 9xwTTdZZTw
Out of curiosity, I let the Microsoft Print to PDF have a try. Opening the resulting pdf, no information is lost but all pages are rotated to portrait. Then converting that file works as it should.
In this case however, all the pages in the pdf do have the same orientation (landscape). When converting to png, the first one is ok, but all of the following pages are put in portrait, so almost half of the image is cut off. I'd add the file, but it's quite large.
So first one's a winner, get the file here:
https://send.firefox.com/download/4955b ... 9xwTTdZZTw
Out of curiosity, I let the Microsoft Print to PDF have a try. Opening the resulting pdf, no information is lost but all pages are rotated to portrait. Then converting that file works as it should.