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

Free Support Forum - aspose.com

Image resolution is lost for PDF when image is resized to a lower size

Hi Team,

When compared to Aspose 13.5 and Aspose 14.4.1, the image resolution is lost in PDF when the image size is reduced.

See standalone code, image, and PDF documents.

Thanks,
Kumar

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Aspose product and version is = " + BuildVersionInfo.getProduct() + " : " + BuildVersionInfo.getVersion());
builder.writeln();

double cellWidth = 50;

Table table = builder.startTable();
Cell cell = builder.insertCell();

cell.getCellFormat().setWidth(cellWidth);
cell.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(cellWidth));
Shape shape = builder.insertImage(“D:\ks\work\RPE_2012\Defects\46874-pdf-image-resolution-lost\image_2.png”);

double shapeWidth = shape.getWidth();
double shapeHeight = shape.getHeight();

if (cellWidth < shapeWidth)
{
double ratio = shapeWidth / shapeHeight;
shapeWidth = cellWidth - cell.getCellFormat().getLeftPadding() - cell.getCellFormat().getRightPadding();
shapeHeight = shapeWidth / ratio;

shape.setWidth(shapeWidth);
shape.setHeight(shapeHeight);
}

builder.endRow();
builder.endTable();

table.setPreferredWidth(PreferredWidth.AUTO);

doc.save(“C:\test_old.doc”);
doc.save(“C:\test_old.pdf”);

Hi Kumar,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 14.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSJAVA-886. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSJAVA-886) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.