Page 1 of 1

Convert multiple multipage TIFFs to multipage PDFs

Posted: Sat Apr 21, 2018 2:44 pm
by azon2111
Trying to get the syntax correct or understand what is wrong with my syntax so that I can fix it.

Trying to convert all tiff files in a directory to pdf files with 1 to 1 ratio. The TIff is multipage and pdf output should be multipage. The source and the destination are the same and permission for the folder is set to everyone full read/write access.

Code: Select all

nconvert -xall -quiet -multi -out pdf N:\ServerFolders\Company\FAXES\Incoming\*.tif
produces a pdf per page for each tiff file instead of combining those pages into one pdf file.

Thank you in advance for any help.

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 2:55 pm
by cday
At a quick look you probably need a -o term, and can set the required path and file name using the options in the Help file...

Could you please try that first, and report back if you don't get the result you need.

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 2:59 pm
by azon2111
Tried adding the -o %.pdf but says cannot create file and it is still trying to produce 1 pdf per page in the tiff file.

Thank you.

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 3:07 pm
by azon2111
And just for reference GhostScript is installed but do I need to place files into the XnView folder?

I used the windows installer for version 9.23 gs dot com site and not .edu as rerefenced in the format txt file.

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 3:17 pm
by azon2111
Okay I got it working by specifying the output path and not just the file name.

What is now happening is with -xall it produces a single file per page pdf and without it only produces pdf's with the first page of a multipage tiff.

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 3:27 pm
by azon2111
I feel I am f=very close but cannot figure out now each file is its own pdf and not combining into a single pdf for multiple tif files

Code: Select all

nconvert -quiet -multi -out pdf -c 1 -o PATH-TO-OUTPUT-FOLDER\%.pdf PATH-TO-INPUT-FOLDER\*.tif
Thank you for any help you can provide.

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 4:01 pm
by cday
azon2111 wrote:
Sat Apr 21, 2018 3:07 pm
And just for reference GhostScript is installed but do I need to place files into the XnView folder?

I used the windows installer for version 9.23 gs dot com site and not .edu as rerefenced in the format txt file.
GhostScript is only required to read PDF files, not to create them, so that is not a factor. It wouldn't normally be installed in the XnView/NConvert folder, rather in Program Files or Program Files (x86), as appropriate. It must be installed using the installer, otherwise NConvert can't find it. The NConvert and GhostScript x32 and x64 must also match.

You are using the right technique: lots of trial and error! :D

I'm firing up my Windows computer to see if I have an example of code that works...

Re: Multipage Fax TIFF to same PDF

Posted: Sat Apr 21, 2018 4:09 pm
by cday
This tested code filed under M-TIFF_to_M-PDF was originally run as a batch file and using relative addressing, but you should be able to adapt it to your case:

Code: Select all

nconvert -out pdf -multi -o M-PDF.pdf M-TIFF.tif
So it looks as if -xall in your code is your immediate problem...

Edit:

To convert multiple TIFFs using *.tif I think you may need to use a FOR loop around the basic code, if you could get your code working for a single TIFF first, and then test whether it will also process multiple input TIFFs as it is...

Re: Multipage TIFF to multipage PDF

Posted: Mon Apr 23, 2018 7:43 pm
by cday
azon2111 wrote:
Sat Apr 21, 2018 2:44 pm
Trying to convert all tiff files in a directory to pdf files with 1 to 1 ratio. The TIff is multipage and pdf output should be multipage. The source and the destination are the same and permission for the folder is set to everyone full read/write access.
Did you find a satisfactory solution?

I had a look at a For loop solution at the weekend, and after a false start I can now offer you the following outline code which seems to produce the desired result in my quick tests:

Code: Select all

FOR %A IN ("C:\Y\*.tif") DO nconvert -out pdf -multi -o "C:\Y\%.pdf" "%A" 
You would need to modify and elaborate that code as necessary, of course.

Replace % by %% everywhere when using the above code in a batch file .bat .

If you have an alternative solution please post it... :D