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
close icon

PDF Header and Flow Model

I need to insert headers and footers into my document, but I also would like to use the flow model insteaed of the grid model. Is there a way to insert headers using the flow model, or is this supported only in the grid model?

5 Replies

AJ Ajish Syncfusion Team July 13, 2006 03:57 PM UTC

Hi Robert, Thank you for your interest in Essential PDF. We do have options to set headers and footer in Flow Model. Please use the following code to set header. //Create a header paragraph IParagraph Headerpara=section.HeadersFooters.Header.AddParagraph(); This would return a paragraph object and using this you can add any paragraph item into the header section and it is the same with the footers. Here is a sample for your reference: DLSHeaderFooters.zip Please take a look at this sample and let me know if you have any further queries. Thanks, Ajish.


AD Administrator Syncfusion Team July 13, 2006 07:25 PM UTC

That worked for me. I do have two other small questions. Is there a way to tell which page of the Ducument I am on? I am looking to put a "Page x of y" line in my header. Also, is there an easy was to tell what the length of a given string is in pixels? I am trying to align a certain piece of dynamically generated text (read from an xml file), and need to know it''s length in order to position it correctly. >Hi Robert, > >Thank you for your interest in Essential PDF. We do have options to set headers and footer in Flow Model. > >Please use the following code to set header. > > >//Create a header paragraph >IParagraph Headerpara=section.HeadersFooters.Header.AddParagraph(); > > >This would return a paragraph object and using this you can add any paragraph item into the header section and it is the same with the footers. > >Here is a sample for your reference: DLSHeaderFooters.zip > >Please take a look at this sample and let me know if you have any further queries. > >Thanks, >Ajish. >


AJ Ajish Syncfusion Team July 13, 2006 09:28 PM UTC

Hi Robert, Sorry for the inconvenience. 1) Currently it is not possible to insert page numbers in headers and footers in Flow. I have created a feature request regarding it you can trac the status of this issue from the following link. http://www.syncfusion.com/support/features/pdf/Default.aspx?ToDo=view&questId=1076 2) The Flow model approach will lay out the elements placed inside a PDF document automatically as they are added into the document. Also there are many formating options which would help you in positioning of the input string without calculating the size of the string. Can you please tell me how you like to align the text this would help me providing options available in flow model. Currently it is not possibe to measure the length. Please let me know if you have any questions. Thanks, Ajish.


AD Administrator Syncfusion Team July 14, 2006 05:41 PM UTC

I would like one piece of text on a line to be right aligned. >Hi Robert, > >Sorry for the inconvenience. >1) Currently it is not possible to insert page numbers in headers and footers in Flow. I have created a feature request regarding it you can trac the status of this issue from the following link. > >http://www.syncfusion.com/support/features/pdf/Default.aspx?ToDo=view&questId=1076 > >2) The Flow model approach will lay out the elements placed inside a PDF document automatically as they are added into the document. Also there are many formating options which would help you in positioning of the input string without calculating the size of the string. Can you please tell me how you like to align the text this would help me providing options available in flow model. Currently it is not possibe to measure the length. > >Please let me know if you have any questions. > >Thanks, >Ajish. > > >


AJ Ajish Syncfusion Team July 14, 2006 05:55 PM UTC

Hi Robert, We do have option to set alignment of text. Here is a code to right align text. paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DLS.HorizontalAlignment.Right; and here is a sample for your reference: http://www.syncfusion.com/Support/user/uploads/TextAlignment_2dc36f1a.zip Please take a look and let me know if you have any questions. Thanks, Ajish.

Loader.
Live Chat Icon For mobile
Up arrow icon