Hello,
Is it possible with imageMagick to crop a pdf to another pdf (with different size) with a command on windows server?
Kind regards,
Pieter
Pdf image crop on windows server
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Pdf image crop on windows server
Yes.
If you want more detail, we need more information. Do you want half the pages, or half of each page, or what? If your input pdf contains vector data or ordinary text, that will be rasterized (converted to pixels).
If you want more detail, we need more information. Do you want half the pages, or half of each page, or what? If your input pdf contains vector data or ordinary text, that will be rasterized (converted to pixels).
snibgo's IM pages: im.snibgo.com
Re: Pdf image crop on windows server
Hello snibgo, that sounds great. Thank you:)
Each pdf is one page with a photo on it, but it has a edge which is white. This white edge is for example 50 millimetre wide.
image hosting site over 5mb
It would great if a pdf can be cropped this way automaticly when a pdf is uploaded to a windows server. Another way is that a pdf can be send from our application to imagemagick with a command to crop the pdf. If one of these ways is possible this could save a lot of time for us:)
Each pdf is one page with a photo on it, but it has a edge which is white. This white edge is for example 50 millimetre wide.
image hosting site over 5mb
It would great if a pdf can be cropped this way automaticly when a pdf is uploaded to a windows server. Another way is that a pdf can be send from our application to imagemagick with a command to crop the pdf. If one of these ways is possible this could save a lot of time for us:)
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Pdf image crop on windows server
Okay. I would extract the photo with pdfimages, a tool available for Unix and Windows. This makes a raster image file, eg "myphoto.jpg". Then use IM to convert that to a PDF:pieter wrote:Each pdf is one page with a photo on it, ...
Code: Select all
convert myphoto.jpg myphoto.pdf
Personally, I can't see the point of a PDF wrapper around raster images, but some people like them.
snibgo's IM pages: im.snibgo.com
Re: Pdf image crop on windows server
I am not sure whether we need pdfimages, because the pdf is actually one picture, (Not a pdf with a picture/photo/jpg in it).
Re: Pdf image crop on windows server
Hello,
An update:
I have installed Image Magick and ghostscript.
I almost got a solution. I removed a white edge of 5 mm at the bottom, but unfortunatly a small white edge appeared at the top of the pdf. It is still a big improvement. I will work further on it.
Some examples:
magick -density 300 -quality 100 input.pdf -gravity South -chop 0X78 output.pdf
magick -density 400 -quality 100 input.pdf -gravity South -chop 0X70 output.pdf
magick -density 300x300 input.pdf -background white -extent 637.794x1003.9371 output.pdf
magick -density 254x254 input.pdf -gravity South -chop 0x59,05512 output.pdf
snibgo, again thanks for your suggestions:D
Pieter
An update:
I have installed Image Magick and ghostscript.
I almost got a solution. I removed a white edge of 5 mm at the bottom, but unfortunatly a small white edge appeared at the top of the pdf. It is still a big improvement. I will work further on it.
Some examples:
magick -density 300 -quality 100 input.pdf -gravity South -chop 0X78 output.pdf
magick -density 400 -quality 100 input.pdf -gravity South -chop 0X70 output.pdf
magick -density 300x300 input.pdf -background white -extent 637.794x1003.9371 output.pdf
magick -density 254x254 input.pdf -gravity South -chop 0x59,05512 output.pdf
snibgo, again thanks for your suggestions:D
Pieter