Page 1 of 2

Converting Multipage TIFF to PDF

Posted: Tue Mar 04, 2014 3:17 pm
by MYasin786
Hi, I am trying to convert Multipage Tiff with different page sizes into PDF, I am able to do this bying Xnview application but not able to do as command line using Xconvert. I used the similar syntax to convert from PDF to TIFF which is working fine but i am unable to reverse the process, Please help.

"C:\Program files\XnView\NConvert.exe" -xall -multi -out pdf "C:\Temp2\Image2PDF-TEST\Janine\tiff-pdf.Tif"

Re: Converting Multipage TIFF to PDF

Posted: Tue Mar 04, 2014 3:47 pm
by MYasin786
I've managed to get it converting into multipage PDF by using the following command line

"C:\Program files\XnView\NConvert.exe" -xall -multi -out pdf -o "C:\Temp2\Image2PDF-TEST\Janine\tiff-pdf.pdf" "C:\Temp2\Image2PDF-TEST\Janine\tiff-pdf.Tif"


how can i improve the quality?

Re: Converting Multipage TIFF to PDF

Posted: Tue Mar 04, 2014 4:08 pm
by cday
MYasin786 wrote:I've managed to get it converting into multipage PDF by using the following command line ...

... how can i improve the quality?
The default Ghostscript dpi is 72, to set a higher value such as 300 please include the following term in your script:

-dpi 300

Re: Converting Multipage TIFF to PDF

Posted: Wed Mar 25, 2015 10:07 am
by gintaras
I cannot manage to do the vice versa: I need to convert multipage PDF to a multipage TIFF. Used it like this:

nconvert -o $\%.tif -out tiff -dpi 200 -xall -multi ak_multi.pdf

I get ak_multi.tiff on the output but the file is singlepage with only the first page of original PDF...

Re: Converting Multipage TIFF to PDF

Posted: Wed Mar 25, 2015 11:24 am
by cday
You need to add this term to create a multipage output file:

Code: Select all

 -multi            : Create a multipage (TIFF/DCX/LDF only)
Note that creation of a multipage PDF output file isn't supported.

Do you have a listing of the full NConvert syntax?

Code: Select all

nconvert -help > nconvert_Help.txt

Re: Converting Multipage TIFF to PDF

Posted: Wed Mar 25, 2015 1:19 pm
by gintaras
As I mentioned I'used -multi to no avail:

nconvert -o $\%.tif -out tiff -dpi 200 -xall -multi ak_multi.pdf

I only need to convert multipage PDF to multipage TIFF, not vice versa.

It seems that in above example either -multi, or -xall doesn't work.

Re: Converting Multipage TIFF to PDF

Posted: Wed Mar 25, 2015 1:26 pm
by gintaras
My nconcert version is 6.70.

Tried -multi and -xall in different places but again- output TIFF is singlepaged although input PDF is two-page:

nconvert -o $\%.tif -out tiff -multi -xall ak_multi.pdf

In resulting TIFF file there's only the first page of corresponding PDF file.

Re: Converting Multipage TIFF to PDF

Posted: Wed Mar 25, 2015 3:21 pm
by xnview
gintaras wrote:My nconcert version is 6.70.

Tried -multi and -xall in different places but again- output TIFF is singlepaged although input PDF is two-page:

nconvert -o $\%.tif -out tiff -multi -xall ak_multi.pdf

In resulting TIFF file there's only the first page of corresponding PDF file.
Please send me your pdf?

Re: Converting Multipage TIFF to PDF

Posted: Wed Mar 25, 2015 3:33 pm
by cday
Sorry, I missed the fact that you already had the -multi term included. :(

The following code works for me in a quick test:

Code: Select all

nconvert -xall -dpi 200 -multi -out tiff -o Multi_TIFF.tif Multi_PDF.pdf
You will probably want to add an output compression option to the above code.

If the above code doesn't work for you, please send your PDF file to Pierre as above, or upload it here.

Note that I normally run my scripts as Windows batch files but I don't think that matters here.

Edit: Code revised to place -multi before -out tiff to avoid creation of a second, spurious output file.

Re: Converting Multipage TIFF to PDF

Posted: Thu Mar 26, 2015 6:05 am
by gintaras
Thank you, Cday your example command. Tried it but again- the output TIFF is only with the first page of PDF.

I attach the PDF I tried to convert.

Re: Converting Multipage TIFF to PDF

Posted: Thu Mar 26, 2015 8:09 am
by cday
This code works for me:

Code: Select all

nconvert -xall -dpi 200 -multi -out tiff -c 8 -o 2paged_exmpl.tif 2paged_exmpl.pdf
I've added JPEG compression to reduce the output file size from 22.64MB to a size within the attachment limit.

If you can reproduce that maybe you can work from there...
2paged_exmpl.tif
(1.27 MiB) Downloaded 323 times
Edit: Which program are you using to view the output TIFF, I'm wondering if you may only be seeing the first page of a file that is actually multi-page?

Re: Converting Multipage TIFF to PDF

Posted: Thu Mar 26, 2015 8:32 am
by xnview
i've tried and the tiff output has 2 pages. Last version? on windows?

Re: Converting Multipage TIFF to PDF

Posted: Thu Mar 26, 2015 8:36 am
by gintaras
I'm using Windows Photo Viewer.

Strangely enough, I can see with it that TIFF you've attached is two paged.

I tried your command with JPEG compression, the output still consisted just one page!

There must be something wrong with my nconvert.exe or my OS.

I downloaded 32 bit version NConvert-win.zip and using it on 64bit Windows7.

I'll try 64bit right away.

By the way, is this ok, that nconvert always returns some "my_error_exit..."?

D:\xNconvert\XnView>nconvert -xall -dpi 200 -multi -out tiff -c 8 -o 2paged_exmpl.tif 2paged_exmpl.pdf
** NCONVERT v6.70 (c) 1991-2015 Pierre-E Gougelet (Feb 18 2015/16:43:07) **
Version for Windows NT/9x/2000/Xp/Vista/7 (All rights reserved)
** This is freeware software (for non-commercial use)
my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
JPEG load : 2480 3507
my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
JPEG load : 2480 3507
Conversion of 2paged_exmpl.pdf into 2paged_exmpl.tif OK

Re: Converting Multipage TIFF to PDF

Posted: Thu Mar 26, 2015 8:52 am
by gintaras
Just tried Windows 64bit version. Again, windows photo viewer shows only the first page:

D:\xNconvert\XnView64>nconvert -xall -dpi 200 -multi -out tiff -c 8 -o 2paged_exmpl.tif 2paged_exmpl.pdf
** NCONVERT v6.70 (c) 1991-2015 Pierre-E Gougelet (Feb 18 2015/16:46:22) **
Version for Windows Xp/Vista/7 x64 (All rights reserved)
** This is freeware software (for non-commercial use)

my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
JPEG load : 2480 3507
my_error_exit...<Not a JPEG file: starts with 0x25 0x50>
JPEG load : 2480 3507
Conversion of 2paged_exmpl.pdf into 2paged_exmpl.tif OK

D:\xNconvert\XnView64>D:\xNconvert\XnView64\2paged_exmpl.tif

Produced file is 925424 bytes while the file you've sent me is 1331590 bytes,- that clearly shows that the problem is not my windows photo viewer.

Re: Converting Multipage TIFF to PDF

Posted: Thu Mar 26, 2015 9:07 am
by cday
I have retested with NConvert x32 6.70 on Windows 7 x64 without any problems, and I don't get the error message in your previous post.

The -c 8 term applies JPEG compression, but in general it would be better also add a -q term to set the quality value, as in -c 8 -q 80. The basic code would therefore become:

Code: Select all

nconvert -xall -dpi 200 -multi -out tiff -c 8 -q 80 -o 2paged_exmpl.tif 2paged_exmpl.pdf
The smaller output file size you obtained may possibly be due to a lower JPEQ quality setting somehow being applied.

The command line is very unforgiving of errors, but you seem to be using identical code...

Could you please upload the output file you are obtaining?