I would like to cut some rectangular pieces from PDF documents and convert every piece to different images (.png) of the same size. İf a piece is small for the fixed size of image, then rest of image will be blank.
3 Answers
ImageMagick
You should be able to do this in a single step using either the crop option for the convert
command in ImageMagick.
From the help of the convert
command (convert --help
)
-crop geometry cut out a rectangular region of the image
This option can be used to cut portions of a pdf file and save it as png in a single step. You can find more help and examples using this (link)
To summarize the linked page, here is the example they used:
convert rose: -crop 3x3@ +repage +adjoin rose_3x3@_%d.png
ImageMagick is cross-platform, so it should work regardless of your OS
You don't say which OS you are using, but regardless you should be able to achieve this using the standard built in software on the three main platforms.
You can open the PDF in the PDF viewer of your choice, take a screen shot of the image/part of the PDF that you want to turn into a .png, and paste into a simple bitmap tool.
On OS X
Open the PDF in Preview. Use CMD + Shift + 4 to take the screen shot of the area that you want, open the resulting Screenshot file on your desktop in Paintbrush, crop the image accordingly (to your required size) and save as a .png file.
On Linux
Open the PDF in Document Viewer. Use mtpaint -s
to take the screenshot, and then in the resulting window, crop the image accordingly (to your required size) and save as a .png file
On Windows
Open the PDF in Foxit. Hit the PrtScrn key, which will take a screenshot and place it in the clipboard, open MSPaint, paste in the screenshot from the clipboard, crop the image accordingly (to your required size) and save as a .png file
-
I have already known paint but it is useless because every time I cut the pieces,i have to arrange its size in paint manually.(for windows)– FrknxFeb 19, 2015 at 16:52
-
Paint is more powerful than you think. You could use Paint to save a blank .png file of your required size first, as a template, i.e.
template.png
. Then open it up, paste in the screenshot image, and then use Save As... to save it under a different filename. That way you set the size one time only, and all subsequent files will be of the same size (as the original template). Easy! :-) Does that help? Feb 19, 2015 at 16:55
FastStone Capture has a Fixed Size Region function that sounds like it'd fit the bill. By default the toolbar button for that function is not there but you can add it via the settings for easy access if you'd prefer to use that over the keyboard shortcut method. When you take a screenshot using that function, options appear to allow you to change the size of the fixed region to suit your needs.
Latest version of the software is not free however. I believe v5.3, (a fairly old version now) appears to be the last freeware version but I don't know if it has the Fixed Size Region option available to it.
I paid for a copy years ago as I rate the software highly.
-
-
1
-
From what I understand of the question, the OP wants to copy different sized portions of the screen and paste into the same sized .png files. To quote: "İf a piece is small for the fixed size of image..." Feb 20, 2015 at 2:33
-
That is what I understood too and I think therefore the Fixed Size Region capture function in FastStone Capture will do the do. Once captured, hit save, each image will be the same size. Feb 20, 2015 at 9:22
-