Convert PDF to JPG in Java
Convert PDF files to JPG with Aspose.Slides for Java without Adobe Acrobat.
Convert PDF to JPG in Java
Aspose.Slides for Java
lets you import PDF files into a presentation and render slides as JPG images. With this Java API, you can convert PDF content without Adobe Acrobat.
Convert PDF to JPG using Java
To convert PDF to JPG, create a Presentation, import the source file with ISlideCollection.addFromPdf, and render the imported slides as images.
Java code for converting PDF into JPG
Presentation presentation = new Presentation();
try {
presentation.getSlides().addFromPdf("input.pdf");
for (ISlide slide : presentation.getSlides()) {
IImage slideImage = slide.getImage(1f, 1f);
try {
slideImage.save("slide_" + slide.getSlideNumber() + ".jpg", ImageFormat.Jpeg);
} finally {
slideImage.dispose();
}
}
} finally {
presentation.dispose();
}
How to convert PDF to JPG using Aspose.Slides for Java API
These are the steps to convert PDF to JPG in Java.
Install Aspose.Slides for Java .
Add a library reference (import the library) to your Java project.
Open the source
PDFfile in Java.Save each slide as a
JPGimage.
Free Online Converter
Convert presentations and slides online.
Convert PDF To Other Supported Formats
You can also convert PDF and save to other file formats. See all supported formats below