Automating Applications On-the-Fly 
by Drew Wildner

Example 1:

IPDFParagraph paragraph = section.AddParagraph();

//ParagraphFormat 
paragraph.ParagraphFormat.Borders.Color = Color.Navy;
paragraph.ParagraphFormat.Borders.BorderType = 
       Syncfusion.DLS.BorderStyle.Single;
//Set the alginment to the center
paragraph.ParagraphFormat.HorizontalAlignment = 
       HorizontalAlignment.Left;

Example 2:

IPDFTextRange textRange = paragraph.AppendText("Sources by State");
textRange.CharacterFormat.Bold = true;
textRange.CharacterFormat.FontSize = 18f;
textRange.CharacterFormat.FontName = "Arial";
textRange.CharacterFormat.TextColor = Color.Red;

Example 3:

//A paragraph style 
IParagraphStyle headerParaStyle =
   doc.AddStyle(StyleType.ParagraphStyle, 
     "headerParaStyle") as IParagraphStyle;

//A text range style 
headerParaStyle.CharacterFormat.FontSize = 18f;
headerParaStyle.CharacterFormat.FontName = "Courier";
headerParaStyle.CharacterFormat.TextColor = Color.Black;
headerParaStyle.CharacterFormat.Italic = true;


Example 4:
	
//Add an image to the header 
System.Drawing.Image logo = 
    System.Drawing.Image.
      FromFile(Server.MapPath("SelectionLogo.png"));
IPDFPicture logoPic = paragraph.AppendPicture(logo);
logoPic.Height = 47;
logoPic.Width = 415;

//add a little spacing in between the logo and the header text 
paragraph.ParagraphFormat.AfterSpacing = 30;	

//Add a paragraph for the text header
paragraph = section.AddParagraph();

Example 5:

IParagraphStyle stateContentHeader =
    doc.AddStyle(StyleType.ParagraphStyle, 
     "stateContentHeader") as IParagraphStyle;
stateContentHeader.CharacterFormat.Bold = true;
stateContentHeader.CharacterFormat.FontSize = 14f;
stateContentHeader.CharacterFormat.TextBackgroundColor = Color.Black;
stateContentHeader.CharacterFormat.FontName = "Arial";
stateContentHeader.CharacterFormat.TextColor = Color.White;
stateContentHeader.ParagraphFormat.LeftIndent = 10f;

Example 6:

IParagraphStyle contentRepositoryStyle =
    doc.AddStyle(StyleType.ParagraphStyle, 
     "contentRepositoryStyle") as IParagraphStyle;
 contentRepositoryStyle.CharacterFormat.Bold = false;
 contentRepositoryStyle.CharacterFormat.FontSize = 12f;
 contentRepositoryStyle.CharacterFormat.FontName = "Arial";
 contentRepositoryStyle.CharacterFormat.TextColor = Color.Black;
 contentRepositoryStyle.ParagraphFormat.LeftIndent = 20f;  



2


