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

Free Support Forum - aspose.com

Floating Image

How do you create a floating image in Aspose.Pdf. I want a paragraph or a set of paragraphs to flow around an image that is horizontally aligned to the right.

Hi,

Thanks for your inquiry.
Here is an example on how to create a floating image:
[C#]
Pdf pdf = new Pdf();
Section section = new Section(pdf);
pdf.Sections.Add(section);

FloatingBox box1 = new FloatingBox(140, 80);
box1.BoxHorizontalPositioning = BoxHorizontalPositioningType.Margin;
box1.Left = 200;
box1.BoxVerticalPositioning = BoxVerticalPositioningType.Page;
box1.Top = 300;

Image image1 = new Image();
image1.ImageInfo.File = “C:/Images/Apple.jpg”;
image1.ImageInfo.ImageFileType = ImageFileType.Jpeg;
box1.Paragraphs.Add(image1);
section.Paragraphs.Add(box1);
pdf.Save(@“F:/temp/test.pdf”);

Please give it a try.
Best regards.