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

Converting PDF File to PNG

$
0
0

Hi,

I am Converting a particular PDF File into PNG format page by page. The output PNG file is not as expected. I have attached the same output File along with input PDF file.

Using aspose for .NET  the same file is getting converted properly....

 

 I am using aspose-pdf-4.5.0. Do I need to configured any additional setting on Document object before converting...?? 

Here is My Java Code

public static void main(String arg[]) throws Exception
    {     
      convertFileToPNGSpecific1("Data/Generated/source1.ppt.pdf", "Data/ConvertedUsingJAVA.png", 1);
    }
    protected static void convertFileToPNGSpecific1(String pFilename,String pOutputName, int pIndex) throws Exception
    {
     com.aspose.pdf.Document lDocument = new com.aspose.pdf.Document(pFilename);
        com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(150);
        com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
       
        com.aspose.pdf.Page lPngPage = lDocument.getPages().get_Item(pIndex);
        jpegDevice.process(lPngPage,pOutputName);    
    }

Thanks in advance....:)

 

Thanks

Dhawal 

 


Viewing all articles
Browse latest Browse all 3131

Trending Articles