Page 1 of 1

PDF to PNG issue

Posted: Mon Feb 09, 2015 4:23 pm
by Brainfreeze8
Hey,

I use nconvert to convert PDF files to PNG images. I always use the command:

nconvert.exe -dpi 300 -out png -merge_alpha -o out.png -xall "file.pdf"

This used to work just fine. But now I have come across a pdf where only the first page converts fine and all the other pages generate a 1 KB sized file.
When I open this pdf (which looks just fine) and print it again as pdf, I get a new pdf file that is 5kb less in size and converts just fine with nconvert. What is going on here?
Is the original not a "valid" pdf for nconvert?

Pdf in question: https://www.dropbox.com/s/zjut7bmoafoie ... 6.pdf?dl=0

Here is part of the output I get from nconvert:
(I tried to look up what the error code -101 means but no success)

Code: Select all

GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dNODISPLAY 
ARG 1 -dQUIET 
ARG 2 -sPDFname=14586.pdf 
ARG 3 -sDSCname=C:\Users\Pieter\AppData\Local\Temp\x_84B0.tmp 
ARG 4 pdf2dsc.ps 
ARG 5 -c quit 
==> 109 
ERROR: -101 
GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dBATCH 
ARG 1 -dMaxBitmap=300000000 
ARG 2 -sDEVICE=tiff24nc 
ARG 3 -dFirstPage=1 
ARG 4 -dLastPage=1 
ARG 5 -q 
ARG 6 -dNOPAUSE 
ARG 7 -dSAFER 
ARG 8 -dTextAlphaBits=4 
ARG 9 -dGraphicsAlphaBits=4 
ARG 10 -g4962x3507 
ARG 11 -r300x300 
ARG 12 -sOutputFile=C:\Users\Pieter\AppData\Local\Temp\x_84E0.tmp 
ARG 13 14586.pdf 
ARG 14 -c quit 
ARG 15 -c quit 
==> 227 
GS>GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dNODISPLAY 
ARG 1 -dQUIET 
ARG 2 -sPDFname=14586.pdf 
ARG 3 -sDSCname=C:\Users\Pieter\AppData\Local\Temp\x_883B.tmp 
ARG 4 pdf2dsc.ps 
ARG 5 -c quit 
==> 109 
ERROR: -101 
GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dBATCH 
ARG 1 -dMaxBitmap=300000000 
ARG 2 -sDEVICE=tiff24nc 
ARG 3 -dFirstPage=2 
ARG 4 -dLastPage=2 
ARG 5 -q 
ARG 6 -dNOPAUSE 
ARG 7 -dSAFER 
ARG 8 -dTextAlphaBits=4 
ARG 9 -dGraphicsAlphaBits=4 
ARG 10 -g3x3 
ARG 11 -r300x300 
ARG 12 -sOutputFile=C:\Users\Pieter\AppData\Local\Temp\x_886A.tmp 
ARG 13 14586.pdf 
ARG 14 -c quit 
ARG 15 -c quit 
==> 221 
GS>GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dNODISPLAY 
ARG 1 -dQUIET 
ARG 2 -sPDFname=14586.pdf 
ARG 3 -sDSCname=C:\Users\Pieter\AppData\Local\Temp\x_88E8.tmp 
ARG 4 pdf2dsc.ps 
ARG 5 -c quit 
==> 109 
ERROR: -101 
GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dBATCH 
ARG 1 -dMaxBitmap=300000000 
ARG 2 -sDEVICE=tiff24nc 
ARG 3 -dFirstPage=3 
ARG 4 -dLastPage=3 
ARG 5 -q 
ARG 6 -dNOPAUSE 
ARG 7 -dSAFER 
ARG 8 -dTextAlphaBits=4 
ARG 9 -dGraphicsAlphaBits=4 
ARG 10 -g3x3 
ARG 11 -r300x300 
ARG 12 -sOutputFile=C:\Users\Pieter\AppData\Local\Temp\x_8928.tmp 
ARG 13 14586.pdf 
ARG 14 -c quit 
ARG 15 -c quit 
==> 221 
GS>GS: (C:\Program Files\gs\gs9.15\bin\gsdll64.dll)
ARG 0 -dNODISPLAY 
ARG 1 -dQUIET 
ARG 2 -sPDFname=14586.pdf 
ARG 3 -sDSCname=C:\Users\Pieter\AppData\Local\Temp\x_89B5.tmp 
ARG 4 pdf2dsc.ps 
ARG 5 -c quit 
==> 109 
ERROR: -101 
Thanks in advance for any responses.

Re: PDF to PNG issue

Posted: Thu Feb 12, 2015 8:35 am
by xnview
yes ghostscript seems to have problem with this file...

Re: PDF to PNG issue

Posted: Thu Feb 12, 2015 10:22 am
by Brainfreeze8
Ok, thanks! Too bad I already use the latest version of Ghostscript...

Re: PDF to PNG issue

Posted: Thu Feb 12, 2015 10:56 am
by cday
Brainfreeze8 wrote:Ok, thanks! Too bad I already use the latest version of Ghostscript...
The file opens normally with Irfanview using Ghostscript, but not with XnViewMP using the same Ghostscript x32 version...

In XnViewMP pages after the first display as a small white rectangle 21 x 16px, accounting for the small file size of the NConvert-extracted files.

So possibly an XnView issue, at least maybe in terms of lower tolerance of a [possibly] malformed PDF file??

Regarding malformed PDF files, the following link may be of interest:

http://superuser.com/questions/773343/v ... -integrity

Re: PDF to PNG issue

Posted: Thu Feb 12, 2015 11:38 am
by Brainfreeze8
Thanks for the reponse Cday. I tried several PDF analysis tools but none have flagged the PDF as damaged/corrupted in any way. The PDFs are processed on a server automaticaly so maybe I should look into a commandline tool to convert my PDF to a "better" PDF before I give it to nconvert.

Re: PDF to PNG issue

Posted: Fri Feb 13, 2015 9:07 am
by xnview
ok, right a bug from XnView and not GS

Re: PDF to PNG issue

Posted: Fri Feb 13, 2015 11:35 am
by Brainfreeze8
Will this possibly be fixed in the future?

Re: PDF to PNG issue

Posted: Sat Feb 14, 2015 7:27 am
by xnview
Brainfreeze8 wrote:Will this possibly be fixed in the future?
yes will be fixed

Re: PDF to PNG issue

Posted: Fri Feb 20, 2015 10:46 am
by Brainfreeze8
I noticed there was an update for nconvert and the pdf I mentioned works now. Thanks a lot!