4

I have used PDFImageWriter class to convert PDF to image file(png). Now i want to crop pictures(images) from the converted image file.I dont know how to do?could any one provide some code for this?

A B
  • 1,926
  • 1
  • 20
  • 42

2 Answers2

1

may be it will work.

private BufferedImage cropImage ( BufferedImage src , Rectangle rect ) {
  BufferedImage dest = src.getSubimage ( rect.x , rect.y , rect.width , rect.height ) ;
  return dest ; 
}
thor
  • 21,418
  • 31
  • 87
  • 173
chandrakant
  • 370
  • 3
  • 25
0

If you are trying to Crop an Image using Java then this may answer your question: java image crop

If you are trying to extract images from a PDF then this may answer your question: How to extract images from pdf using Java (not using pdfbox)

Community
  • 1
  • 1
Micah
  • 1,221
  • 17
  • 42