Hi,
Hi Vishal,
Hi Shahbaz,
Hi Vishal,
//Instantiate Pdf instance by calling
its empty constructor<o:p></o:p>
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
// Create section object and add it to sections collection of PDF
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
// Create FloatingBox with 108 as width and 80 as height
Aspose.Pdf.Generator.FloatingBox box1 = new Aspose.Pdf.Generator.FloatingBox(108, 80);
// add FloatingBox to paragraphs collection of section object
sec1.Paragraphs.Add(box1);
box1.Border = new BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, new Aspose.Pdf.Generator.Color("Navy"));
// Specify the Horizontal Positioning type for FloatingBox as Margin
box1.BoxHorizontalPositioning = Aspose.Pdf.Generator.BoxHorizontalPositioningType.Margin;
// Set the left margin information as 200
box1.Left = 200;
// Specify the Vertical Positioning type for FloatingBox object
box1.BoxVerticalPositioning = Aspose.Pdf.Generator.BoxVerticalPositioningType.Page;
// Set the Top margin information as 300
box1.Top = 300;
// add sample text string to paragraphs collection of FloatingBox object
box1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("Hello."));
// create Floatingbox object
Aspose.Pdf.Generator.FloatingBox imagebox = box1.Clone() as Aspose.Pdf.Generator.FloatingBox;
sec1.Paragraphs.Add(imagebox);
// create image object for background image
Aspose.Pdf.Generator.Image img = new Aspose.Pdf.Generator.Image();
img.ImageInfo.File = "c:/pdftest/Logo.jpg";
imagebox.Paragraphs.Add(img);
// set the Zorder as negative so that its displayed behind text on page
imagebox.ZIndex = -1;
// Save the resultant PDF document
pdf1.Save(“c:/pdftest/FloatingBox_ImageBackGround.pdf”);