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

Is there an Issue with Image.Margin

$
0
0
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 Imagesection );image.ImageInfo.ImageStream = new MemoryStream(myImageData.ImageDataBytes);image.ImageInfo.ImageFileType = ImageFileType.Jpeg;image.ImageInfo.Title = myImageData.Caption.TextContent;image.IsInList = false;// Scaling if too largefloat 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 / imageWidthimage.ImageScale = scaleimage.ImageInfo.Title += string.FormatReportingServiceRenderer.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

Viewing all articles
Browse latest Browse all 3131

Trending Articles