We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert PDF Pages to vector image formats

Hi,

I am using aspose-pdf-9.5.2-jdk16.jar.
Is there a way to convert a PDF page into vector image format.
Currently I am using following code to generate JPEG’s but my requirement is vector images.

for (int pageCount = 1; pageCount <= pdfDocument.getPages().size(); pageCount++) {
String imageFilePath = FileUtils.getAbsoluteFilePath(sourcePath, pageCount + “”, “jpeg”);
// Create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream(imageFilePath);
try {
// Create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
// Create JpegDevice object where second argument indicates the quality of resultant image
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
RasterImagesSavingModes rasterImagesSavingModes =
jpegDevice.setRenderingOptions(value);
// Convert a particular page and save the image to stream
jpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);
} finally {
// Close the stream
imageStream.close();
}
ImageInfo imageInfo = new ImageInfo(1, imageFilePath, “”);
imageInfos.add(imageInfo);
}

Thanks
Jaspreet

Hi Jaspreet,


Thanks for your inquiry. You can convert PDF to SVG using Aspose.Pdf for Java. Please check following documentation link for details/code snippet.


Please feel free to contact us for any further assistance.

Best Regards,