Page 1 of 1

Error in converted PDF

Posted: Wed Feb 06, 2019 6:43 am
by punith8626
HI ALL,

I have a png file and I am trying to convert to PDF using nconvert. The resultant file which is generated is not correct and its not opening.
Getting below Error when i open the PDF.

Code: Select all

There was an error processing a page. There was a problem reading this document(14).
Please find the attached png file for testing.

Here is the command I have used to convert the png to PDF.

Code: Select all

nconvert -out  pdf -multi -c 1 -overwrite -o C:\Users\test\Desktop\tiff\t\test.pdf C:\Users\test\Desktop\tiff\t\test.png
testimage.png
testimage.png (4.07 KiB) Viewed 2289 times

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 7:10 am
by cday
For the PDF compression term please try:

Code: Select all

-out  pdf -c 1 

And for a single input file, the -multi term is not required and may be causing a problem, for multiple input files try placing term in another position in your code.

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 7:36 am
by punith8626
cday wrote: Wed Feb 06, 2019 7:10 am For the PDF compression term please try:

Code: Select all

-out  pdf -c 1 

And for a single input file, the -multi term is not required and may be causing a problem, for multiple input files try placing term in another position in your code.
I tried with both ways and did not succeed.
Did you try to convert the file that I attached ?

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 7:50 am
by cday
I can't easily test your code as I am on vacation and only have my laptop.

You tried removing the -multi term when using a single input file?

Your test PNG is 32-bit, possibly that is relevant?

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 8:16 am
by cday
You are trying to save a 32-bit image as a 1-bit black and white image, please see this post which may be relevant.

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 8:51 am
by punith8626
cday wrote: Wed Feb 06, 2019 7:50 am I can't easily test your code as I am on vacation and only have my laptop.

You tried removing the -multi term when using a single input file?

Your test PNG is 32-bit, possibly that is relevant?
Yes the test png is 32 bit depth.
I have used below command

Code: Select all

nconvert -out  pdf  -c 1 -overwrite -o C:\Users\test\Desktop\tiff\t\test.pdf C:\Users\test\Desktop\tiff\t\test.png

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 8:58 am
by cday
punith8626 wrote: Wed Feb 06, 2019 8:51 am I have used below command

Code: Select all

nconvert -out  pdf  -c 1 -overwrite -o C:\Users\test\Desktop\tiff\t\test.pdf C:\Users\test\Desktop\tiff\t\test.png
Does it work?

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 9:02 am
by punith8626
cday wrote: Wed Feb 06, 2019 8:58 am
punith8626 wrote: Wed Feb 06, 2019 8:51 am I have used below command

Code: Select all

nconvert -out  pdf  -c 1 -overwrite -o C:\Users\test\Desktop\tiff\t\test.pdf C:\Users\test\Desktop\tiff\t\test.png
Does it work?
No

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 9:09 am
by cday
punith8626 wrote: Wed Feb 06, 2019 9:02 am
cday wrote: Wed Feb 06, 2019 8:58 am
punith8626 wrote: Wed Feb 06, 2019 8:51 am I have used below command

Code: Select all

nconvert -out  pdf  -c 1 -overwrite -o C:\Users\test\Desktop\tiff\t\test.pdf C:\Users\test\Desktop\tiff\t\test.png
Does it work?
No

Please try converting the input 32-bit file to black and white before saving to PDF with CCITT G4 compression, as in the link above...

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 9:21 am
by punith8626
cday wrote: Wed Feb 06, 2019 9:09 am
punith8626 wrote: Wed Feb 06, 2019 9:02 am
cday wrote: Wed Feb 06, 2019 8:58 am

Does it work?
No

Please try converting the input 32-bit file to black and white before saving to PDF with CCITT G4 compression, as in the link above...
I have situation like this:
I have colored multi tiff image from that I need to convert perticular images to PDF.
Before I was having only black and white images and I was converting black and white multi tiff images to png and then i was generating PDF from that.

Now I have colored multi tiff but I am not able to convert to PDF

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 9:24 am
by punith8626
punith8626 wrote: Wed Feb 06, 2019 9:21 am
cday wrote: Wed Feb 06, 2019 9:09 am
punith8626 wrote: Wed Feb 06, 2019 9:02 am
No

Please try converting the input 32-bit file to black and white before saving to PDF with CCITT G4 compression, as in the link above...
I have situation like this:
I have colored multi tiff image from that I need to convert perticular images to PDF.
Before I was having only black and white images and I was converting black and white multi tiff images to png and then i was generating PDF from that.

Now I have colored multi tiff but I am not able to convert to PDF
I tried with below command

Code: Select all

nconvert -out  pdf  -binary nodither -multi  -overwrite -o C:\Users\test\Desktop\tiff\t\test.pdf C:\Users\test\Desktop\tiff\t\*.png
I am able to convert to PDF but clarity is not good and I am getting only black and White.

Re: Error in converted PDF

Posted: Wed Feb 06, 2019 9:38 am
by cday
punith8626 wrote: Wed Feb 06, 2019 9:24 am I am able to convert to PDF but clarity is not good and I am getting only black and White.

The PDF compression option in your original code is CCITT G4, which is a black and white option.

If you wish to retain colour, use one of the compression options that support colour...

I'm not sure how retaining a 32-bit image, if you need to, might limit your choice of compression method, possibly not a factor?