Good day to all!
Please tell me if it is possible to use the converter utility to process and save a multi-page TIF file without having to parse it page by page? Any attempt I make to process a multi-page TIFF results in a single-page TIFF, and only pagination produces the result.
SAMSAM wrote: Sat Mar 13, 2021 6:13 pm
Please tell me if it is possible to use the converter utility to process and save a multi-page TIFF file without having to parse it page by page? Any attempt I make to process a multi-page TIFF results in a single-page TIFF, and only pagination produces the result.
You want to convert a multi-page TIFF directly to a multi-page TIFF, presumably performing some operation(s) on each page?
I'm not sure what you mean exactly by parsing each page and by pagination, but perhaps that doesn't matter.
There are a number of tasks, such as resaving the tif with a different type of compression or deleting metadata. At the moment, I first split a multi-page file, then process it page by page, and then assemble it into a multi-page file. Is it possible to do this without pagination. If yes, please write an example for nconvert.
I knew it is possible to convert multipage to multi-page because I tested various combinations of multi-TIFF to multi-TIFF and multi-PDF to multi-PDF some years ago, and after some quick tests the following outline code works for me:
You will probably need to add suitable compression for your case, and can find that and filename options from the help file.
Note that if you are viewing the output multi-page file in XnView MP, you step between the pages using the small toolbar arrows, not the usual larger ones.
SAMSAM wrote: Sat Mar 13, 2021 7:35 pm
Thank you, everything worked fine! Now I have dealt with this issue. My mistake was putting the "-multi" command before the "-out tiff" command.
In general, the order of options doesn't seem to matter much -- there is no documentation on that point that I know of except that the input term must be the last right-most term -- but in the above case the order does matter, I think.
Now I checked it on an array of multi-page tif files. And it turned out that the proposed set of commands works only on a single multi-page file. When you try to process an array of multiple multi-page files, the result is combined into a single file. Here is my example (for totalcommander)
-rmeta -out tiff -multi -c 2 -c_bw 7 -o New\%%.tif %S
What is the error?
I'm not familiar with Total Commander, but if you need to batch process multi-page files in Windows using CMD, I would think you would probably need to place the above code for a single input file within a For loop.
I am an inexperienced command line user and provide support for NConvert because no-one else does except Pierre, who has very limited time, and while I have managed to use For loops, I'm afraid I can't provide support for that.
There is a good chance that you have more experience with For loops than I do, but looking through some of my old scripts the following code (adapted for multi-page TIFF output rather than PDF output) may be relevant if you don't have a solution yet:
For %%A In ("C:\Y\*.tif") Do nconvert -out tiff -multi -o "C:\Y\%%.tif" "%%A"
Absolutely no warranty!
Edit: The fact that in the above version both input and output files are TIFFs probably requires a tweak, such as putting the output files in a different directory to avoid the risk of creating an infinite loop, or a suitable choice of input filenames.