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

PngDevice.Process cutting off image

$
0
0

We are converting PDF files to PNG files using PngDevice.Process.  For most documents, it works fine, but we have a few where the process is cutting off the right side of the drawing.  A few notes:

  • If we use a resolution of 100 DPI, it works fine
  • If we use a resolution of 200 DPI, it cuts off more than at 300 DPI
  • JpegDevice.Process gives the same results

I have attached a copy of the original PDF as well as 100, 200, and 300 DPI converted copies.  Does anyone have any ideas?  The code being used is below:

Aspose.Pdf.

License license = new Aspose.Pdf.License();

license.Embedded =

true;

license.SetLicense(

"Aspose.Total.lic");

Aspose.Pdf.

Document asposeDoc = null;

string fileName = @"C:\Users\q41775\Desktop\Aspose Test Docs\71154001.pdf";

string exportFileName = @"C:\Users\q41775\Desktop\Aspose Test Docs\exported\71154001_" + txtResolution.Text + ".png";

if (System.IO.File.Exists(exportFileName))

{

System.IO.

File.Delete(exportFileName);

}

asposeDoc =

new Aspose.Pdf.Document(fileName);

Resolution resolution = newResolution(Convert.ToInt32(txtResolution.Text));

PngDevice pngDevice = newPngDevice(resolution);

pngDevice.Process(asposeDoc.Pages[1], exportFileName);

Viewing all articles
Browse latest Browse all 3131

Trending Articles