public static void UsingInlineParagraph()
{
// ExStart:UsingInlineParagraph
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_TechnicalArticles();
// Instantiate a Pdf object by calling its empty constructor
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
// Create a section in the Pdf object
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
//=====================================================//
// Header to show an Image inline with text
//=====================================================//
// Create Header Section of the document
Aspose.Pdf.Generator.HeaderFooter header = new Aspose.Pdf.Generator.HeaderFooter(sec1);
// Set the Odd header for the PDF file
sec1.OddHeader = header;
// Set the Even Header for the PDF file
sec1.EvenHeader = header;
// Create a Text object
Aspose.Pdf.Generator.Text txt1 = new Aspose.Pdf.Generator.Text();
// Add text to Header section of the Pdf file
header.Paragraphs.Add(txt1);
// Add the text string to Segment of text object
txt1.Segments.Add("Aspose.Pdf is a Robust component by");
// Specify the color & Font information using TextInfo property
txt1.TextInfo.Color = new Aspose.Pdf.Generator.Color("Blue");
txt1.TextInfo.FontName = "Helvetica";
// Create a new segment to be added to text object
Aspose.Pdf.Generator.Segment seg1 = txt1.Segments.Add();
// Create an image object in the section
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
// Set the path of image file
image1.ImageInfo.File = dataDir + "aspose-logo.jpg";
// Set the type of image using ImageFileType enumeration
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Jpeg;
// Set the image width Information
image1.ImageInfo.FixWidth = 150;
// Indicate seg1's InlineParagraph is a image.
seg1.InlineParagraph = image1;
// Create a new segment to be added to text object
Aspose.Pdf.Generator.Segment seg2 = txt1.Segments.Add("Pty Ltd.");
seg2.TextInfo.Color = new Aspose.Pdf.Generator.Color("Maroon");
// Save the Pdf
pdf1.Save( dataDir + "ImageAndPageNumberInHeaderFooter_UsingInlineParagraph_out.pdf");
// ExEnd:UsingInlineParagraph
}
public static void UsingFloatingBox()