Page 1 of 1
Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Single
Posted: 2014-01-04T14:12:23-07:00
by tareywolf
I just started using ImageMagick and it is working perfectly for my needs, mostly conversion of file types. I just need to know how to use it to convert multiple page PDFs to single page tiffs or PDFs and also how to convert multiple page tiffs to single tiffs or pdfs, using mogrify, and to also select an output path (-path).
Is there any kind of switch that will delete the original files after they have been converted? Haven't been able to find that.
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-04T14:27:58-07:00
by snibgo
To convert a multi-page PDF to a single tiff image (with the input pages beneath each other):
The same will work if the output is pdf or the input is tiff. However, IM will rasterise an input PDF, so an output PDF will contain one large raster (bitmap) image. If the inputs are large you can gobble memory.
I don't know how to do it in mogrify.
To delete input images after they have been used, try the prefix "ephemeral:".
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-04T14:57:52-07:00
by tareywolf
Hey thanks....How would I tweak this to do it batch on a whole folder?
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-04T15:00:14-07:00
by tareywolf
...or does this do batch?
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-04T15:30:11-07:00
by fmw42
I was not sure this would work, but it does.
# create two test pdf files each with 3 pages
convert rose: rose: rose: rose1.pdf
convert rose: rose: rose: rose2.pdf
# use mogify to append each page horizontally
mogrify -format tif +append rose*.pdf
For mogrify, see
http://www.imagemagick.org/Usage/basics/#mogrify
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-05T05:36:07-07:00
by tareywolf
Hi - I thoroughly perused the website, including the mogrify section. +append isn't the right command... What I have right now will convert a PDF to a Tif and render it in the same format as the original - in other words, if the PDF is multipage, it will output Tif multipage. If the PDF is single page it will output as a single tif.
mogrify -format tif *.pdf
Is there some script or switch that will tell mogrify to convert PDF multi to single tif? Not appended as one image, but each output file coming out one after another into the folder, with the ".tif" filetype?
I have something I am using right now. It does work, though it puts the output into the same directory as the input/bat file I'm running. So either I need to know how to designate an output folder with this command below or learn how to accomplish the same thing with Mogrify:
:: Change %%~ni to %%~ni_%%03d to export out single-page tif's
@ECHO OFF
FOR %%i in (*.pdf) DO (
ECHO Processing "%%i"...
convert -density 300 -units PixelsPerInch -compress Group4 %%i %%~ni_%%03d.tif
)
Thanks.
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-05T05:42:59-07:00
by snibgo
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-05T06:01:07-07:00
by tareywolf
I think another great question is... what language are these shell or mogrify commands in - unix? bash?
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-05T06:07:38-07:00
by snibgo
Windows BAT.
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-05T06:31:07-07:00
by tareywolf
Thanks a lot for your input. The +adjoin doesn't seem to work with mogrify unfortunately. Get a command not recognized error. I'll keep churning away...
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-05T12:45:33-07:00
by fmw42
mogrify only produces one output for each input. It is very simple and does not allow many IM commands. You will likely need to write a script loop over each pdf and then use convert to process to multiple output images.
Re: Mogrify Convert Multi PDF to Single PDFs,Multi Tif to Si
Posted: 2014-01-06T04:04:39-07:00
by tareywolf
Thanks...
