Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Pdf to image conversion in Linux

$
0
0

Hi,

Below is the error that is occurring when trying to convert PDF document into Images using Aspose API on Linux. Same code is working fine on windows.

 at com.aspose.ms.System.a.f.get_Item(Unknown Source)
 at com.aspose.pdf.a.b.e.b.d.a(Unknown Source)
 at com.aspose.pdf.a.e.a.a(Unknown Source)
 at com.aspose.pdf.a.j.b.g.a(Unknown Source)
 at com.aspose.pdf.a.j.h.a(Unknown Source)
 at com.aspose.pdf.Z.a(Unknown Source)
 at com.aspose.pdf.TiffDevice.processInternal(Unknown Source)
 at com.aspose.pdf.TiffDevice.process(Unknown Source) at com.aspose.ms.System.a.f.get_Item(Unknown Source)
 at com.aspose.pdf.a.b.e.b.d.a(Unknown Source)
 at com.aspose.pdf.a.e.a.a(Unknown Source)
 at com.aspose.pdf.a.j.b.g.a(Unknown Source)
 at com.aspose.pdf.a.j.h.a(Unknown Source)
 at com.aspose.pdf.Z.a(Unknown Source)
 at com.aspose.pdf.TiffDevice.processInternal(Unknown Source)
 at com.aspose.pdf.TiffDevice.process(Unknown Source)

I am using Aspose.pdf 4.2.0.

Below is the code for the same.

com.aspose.pdf.Resolution resolution =

new com.aspose.pdf.Resolution(

300);

// Create a thumbnail image (100x100)

com.aspose.pdf.facades.PageSize thumbnailPageSize =

new com.aspose.pdf.facades.PageSize(

24f, 24f);

// 100 x 100

com.aspose.pdf.TiffDevice thumbnailTiffDevice =

new com.aspose.pdf.TiffDevice(

thumbnailPageSize, resolution);

ByteArrayOutputStream thumbnailPageOutputStream =

new ByteArrayOutputStream();

thumbnailTiffDevice.process(pdfDocument, pageIndex, pageIndex,

thumbnailPageOutputStream);

com.aspose.pdf.Resolution resolution =

new com.aspose.pdf.Resolution(

300);

// Create a thumbnail image (100x100)

com.aspose.pdf.facades.PageSize thumbnailPageSize =

new com.aspose.pdf.facades.PageSize(

24f, 24f);

// 100 x 100

com.aspose.pdf.TiffDevice thumbnailTiffDevice =

new com.aspose.pdf.TiffDevice(

thumbnailPageSize, resolution);

ByteArrayOutputStream thumbnailPageOutputStream =

new ByteArrayOutputStream();

thumbnailTiffDevice.process(pdfDocument, pageIndex, pageIndex,

thumbnailPageOutputStream);

 

I have attached the test document.


Viewing all articles
Browse latest Browse all 3131

Trending Articles