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

Free Support Forum - aspose.com

Is there an Issue with Image.Margin

Hello Aspose,

currently I’m evaluating Aspose.pdf 9.6.0.
I observe a problem with image margin and image title.
The following snippet should demonstrate the code fragment which is running for two images. One small and one oversize which is zoomed automatically to fit to page:

Image image = new Image( section );
image.ImageInfo.ImageStream = new MemoryStream(myImageData.ImageDataBytes);
image.ImageInfo.ImageFileType = ImageFileType.Jpeg;
image.ImageInfo.Title = myImageData.Caption.TextContent;
image.IsInList = false;

// Scaling if too large
float pageWidth = (section.Section.PageInfo.PageWidth - section.Section.PageInfo.Margin.Left - section.Section.PageInfo.Margin.Right) / 72;
float imageWidth = (float)this.myImageData.ImageWidth/this.myImageData.ImageHorizontalResolution;
if ( pageWidth < imageWidth )
{
float scale = pageWidth / imageWidth;
image.ImageScale = scale;
image.ImageInfo.Title += string.Format( ReportingServiceRenderer.AutoZoomString, Convert.ToInt32(scale * 100) );
}
image.Margin.Bottom = 50;
image.Margin.Top = 50;
image.Margin.Left = 0;
image.Margin.Right = 0;

1) In the resulting PDF I cannot see that the bottom margin of 50pt is used, but top margin seems to work.
2) The image text appears very close to the image. Are there any formating options for it?

Regards
Gerd

Hi Gerd,

Thanks for your inquiry. While testing the scenario with your shared document, we have managed to reproduce the issue with latest version of Aspose.Pdf for .NET 9.9.0. We have logged a ticket PDFNEWNET-37959 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Thanks Tilal for your support

Regards

Gerd

The issues you have found earlier (filed as PDFNEWNET-37959) have been fixed in Aspose.Pdf for .NET 11.1.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.