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

Free Support Forum - aspose.com

Image size is increasing in generated PDF document

Hi,

We have upgraded the product to v6.4 and observed that image size is increasing in generated pdf. Image is displaying correctly in html view but size is increasing in pdf document. We are using following code:

string comments = "

  1. this is sample test.
  2. this is second test.
  3. third line

http://10.11.164.232:8092/Uploads/propscilogo.GIF" width=251 height=59>

";

TextInfo textinfoComment = new TextInfo();
textinfoComment.Alignment = AlignmentType.Justify;

Aspose.Pdf.Table tab14 = new Aspose.Pdf.Table();
tab14.DefaultCellPadding = margin;
tab14.ColumnWidths = "5% 95%";

Row row00 = tab14.Rows.Add();
Cell cell = row00.Cells.Add("Conclusion");
cell.ColumnsSpan = 2;
cell.DefaultCellTextInfo = textinfo;

Text commentText = new Text(comments);
commentText.IsHtmlTagSupported = true;

Row row20 = tab14.Rows.Add();
row20.Cells.Add("");

Aspose.Pdf.Cell cell2 = row20.Cells.Add();
cell2.DefaultCellTextInfo = textinfoComment;
cell2.Paragraphs.Add(commentText);

section.Paragraphs.Add(tab14);

Regards,
Surya

Hi Surya,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please share the image file you are using with us to reproduce the issue at our end (as I am not able to connect to the server you are using in your code). This will help us check and figure out your issue soon. Also, I noticed that you are still using Aspose.Pdf.Table instead of the latest Aspose.Pdf.Generator.Table. Please update your code accordingly to use the latest apis of Aspose.Pdf for .NET 6.x.

Thank You & Best Regards,

Hi Aslam,
We have updated the code after product upgradation. Now we are using Aspose.Pdf.Generator.Table only. Please find the attached image for your reference.

Thanks,

Surya

Hi Surya,


Thanks for sharing the image file. I have tested the scenario and have observed that image dimensions are increasing when HTML string is converted into PDF format. For the sake of correction, I have logged this problem as PDFNEWNET-32034 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for this inconvenience.

However as a workaround, if you set the value of image dimensions in HTML string as width=140 height=38, the output is much better. See the attached PDF document which I have generated with Aspose.Pdf for .NET 6.4.2.

The issues you have found earlier (filed as 32034) have been fixed in this update.


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

Hi,

I have upgraded Aspose.Pdf v6.4 to v6.5. Still image size is increasing in generated pdf document.

Regards,

Surya

Hi Surya,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the feedback.

You have set fixed width and height for the image in your code (width=251 height=59). Are you sure you want to delete ?

Please remove it from your code to get the original size of the image.

Thank You & Best Regards,