Convert PDF to JPG with minimum side length
Convert PDF to JPG with minimum side length
Hi,
thanks for that nice program.
Now I have an question: is ist possible to convert an PDF to an certain side length - wherein the other side changes proportionally.
Sometimes I have small PDF with VectorImages - now I want to convert them to jpg or gif with the smalest side 300 pix - the other side will change proportionally. It doesnt matter if the small side is vertically or horizontally. Untill now i could not find a way.
Thank you in advance for your advices.
thanks for that nice program.
Now I have an question: is ist possible to convert an PDF to an certain side length - wherein the other side changes proportionally.
Sometimes I have small PDF with VectorImages - now I want to convert them to jpg or gif with the smalest side 300 pix - the other side will change proportionally. It doesnt matter if the small side is vertically or horizontally. Untill now i could not find a way.
Thank you in advance for your advices.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert PDF to JPG with minimum side length
Try this:
Code: Select all
-resize "300x300^"
snibgo's IM pages: im.snibgo.com
Re: Convert PDF to JPG with minimum side length
Hi, the other side should resize porportionally - not in the same way. Like the PDF is 600 x 700 - the jpg should be 300 x 350 ...
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert PDF to JPG with minimum side length
Did you try my suggestion? Didn't it work?
snibgo's IM pages: im.snibgo.com
Re: Convert PDF to JPG with minimum side length
Sorry, I have the" ^ "overlooked and thought that does not work. But: I tried it - and it works - GREAT - there is only one problem: the background of the JPG is now black instead of white! Before with 1: 1 conversion the background remained white.
Now i have an other problem with converting more than one file. I worte
for %%f in (*.pdf) do convert -resize "4000x4000^" "%%f".pdf "%%f".jpg
Unfortunatly it doesnt work - did i use a wrong term in Imagemagick?
Now i have an other problem with converting more than one file. I worte
for %%f in (*.pdf) do convert -resize "4000x4000^" "%%f".pdf "%%f".jpg
Unfortunatly it doesnt work - did i use a wrong term in Imagemagick?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert PDF to JPG with minimum side length
I suspect your PDF background wasn't white, but transparent. Try "-background pink -layers flatten" after reading it. If the background is now pink, then that was the problem, and you should use white instead of pink.
"convert" should read the input, then process it, then write the output.
"convert" should read the input, then process it, then write the output.
Give me a clue. What didn't work? What happened instead? Did you get an error message?fffranz wrote:Unfortunatly it doesnt work ...
snibgo's IM pages: im.snibgo.com
Re: Convert PDF to JPG with minimum side length
Hi Snibgo,
Thanks for your note - I try the same time. Best, the background would remain white.
Batch processing does not work. I have a For / Do loop to convert several different PDFs. They all have different sizes and I would like to have a minimum of 300 pixeln of all. In the window is always always: No such file or image ... I think I have a mistake in selecting the different files one after the other. Is %% f perhaps wrong?
Thank you for your suggestions.
Thanks for your note - I try the same time. Best, the background would remain white.
Batch processing does not work. I have a For / Do loop to convert several different PDFs. They all have different sizes and I would like to have a minimum of 300 pixeln of all. In the window is always always: No such file or image ... I think I have a mistake in selecting the different files one after the other. Is %% f perhaps wrong?
Thank you for your suggestions.
Re: Convert PDF to JPG with minimum side length
-background pink -layers flatten doesnt change anything. But no, the JPG is white again, i did nothing
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert PDF to JPG with minimum side length
Ah, I've seen the problem.
You set %%f to the filename, eg abc.pdf. But then you use "%%f%".pdf, so this will be abc.pdf.pdf.
You set %%f to the filename, eg abc.pdf. But then you use "%%f%".pdf, so this will be abc.pdf.pdf.
snibgo's IM pages: im.snibgo.com
Re: Convert PDF to JPG with minimum side length
You are right, sorry, i have problems with using this tokens. Is there an simple command, to convert (not to overwrite - like in mogrify) all PDF-files in an folder?
Re: Convert PDF to JPG with minimum side length
mogrify -format jpg -resize "4000x4000^" *.pdf
This works now - and its simple enough for me. Thank you for your help!
Greetings from Berlin
Franz
This works now - and its simple enough for me. Thank you for your help!
Greetings from Berlin
Franz
Re: Convert PDF to JPG with minimum side length
Finaly i use this batch convertign PDF in JPG:
mogrify -format jpg -resize "300x300^" -colorspace CMYK -type truecolor -quality 100 -set units PixelsPerInch -density 300 *.pdf
No black Background and good quality
mogrify -format jpg -resize "300x300^" -colorspace CMYK -type truecolor -quality 100 -set units PixelsPerInch -density 300 *.pdf
No black Background and good quality
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG with minimum side length
Why do you want to convert to CMYK colorspace? That seem odd to me.