We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Aligning Text in PDFLogicDocument

Hi, I am trying to align text in a PDFLogicDocument and I am not seeing a way to do this. Is this not available? I see how to align text and add style to a PDFDocument and was hoping to do the same in a PDFLogicDocument. Thanks, Michelle

1 Reply

AD Administrator Syncfusion Team June 8, 2006 05:02 AM UTC

Hi Michelle, 1) We do have support for various Text Formatting options usnder PDFLogic Document. Some of the formatting options available are:
  • Change the font of text or numbers.
  • Change the size of text or numbers.
  • Apply bold formatting to text or numbers.
  • Apply italic formatting to text or numbers.
  • Apply strike through formatting to text or numbers.
  • Change the color of text and numbers.
  • Here is a code to set alignment properties of a paragraph, paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Center Here is a sample which demonstrates formating options of PDFLogicdocument: TextFormatting.zip 2) We do have support for styles in PDFLogicdocument. Here is code, which creates a Paragraph style object: IPDFParagraphStyle style1 = document.AddStyle( StyleType.ParagraphStyle, "style1" ) as IPDFParagraphStyle; style1.CharacterFormat.FontSize = 20; style1.CharacterFormat.RenderMode = RenderMode.FillStroke; style1.CharacterFormat.WordSpace = 5; style1.CharacterFormat.TextColor = Color.FromArgb( 222, 100, 19 ); Here is a code, which applies a created paragraph style object to a paragraph: IPDFParagraph paragraph1 = section.AddParagraph(); paragraph1.ApplyStyle( "style1" ); Here is a sample for your reference: FormattingUsingStyles.zip Please take a look at the sample let me know if you need any further assistance. Thanks, Ajish.

Loader.
Live Chat Icon For mobile
Up arrow icon