Page setup and page margins

I am using SfRichTexBoxAdv in UWP. How can I change the page margins and page size after I load the word document.

11 Replies

PS Premkumar Sundaramoorthy Syncfusion Team February 14, 2020 11:00 AM UTC

Hi Naweed,
 
Thank you for contacting Syncfusion support.
 
 
In our SfRichTextBoxAdv control, page margin and page size properties are available in section format class. Please find the following API links to change the page margin and page size.
 
 
We have also created a sample to demonstrate how to change page size and page margin after loading the document. The sample can be downloaded from the following link.   
 
Please let us know if you need any further assistance.  
  
Regards,
Premkumar 



NA Naweed Ashraf February 14, 2020 11:29 AM UTC

Thanks a lot,
Your quick response is highly appreciated.
Regards


NA Naweed Ashraf February 15, 2020 12:42 PM UTC

Respected Sir,
The method you given works well. It sets the page size and margins.

But there is one problem, after setting these two parameter, the position of the cursor is lost. It is no more within the richTextBox. How that can be put back into the richTextBox.

Regards


PS Premkumar Sundaramoorthy Syncfusion Team February 17, 2020 06:39 AM UTC

Hi Naweed,  
 
Thank you for your update.
 
 
We are glad to know that the provided details resolve the reported problem in your end. 

Since you have mentioned that the cursor position is lost in RichTextBox after using the provided code example, we suggest to use the following code to set focus to the control, while changing the page setting properties. 
 
richTextBoxAdv.Focus(FocusState.Programmatic);  
  
   
For further reference, we have modified the sample to demonstrate the same which can be downloaded from the following location.  
 
Please let us know if you need any further assistance,   
 
Regards,  
Premkumar



NA Naweed Ashraf February 21, 2020 06:04 PM UTC

Thanks a lot for all of your favors.
One more favor please.
Please define how to add headers and footer.
Where the property of section located to add header and footer.

Regards


PS Premkumar Sundaramoorthy Syncfusion Team February 24, 2020 10:45 AM UTC

Hi Naweed,

Thank you for your update.

Our SfRichTextBoxAdv control has HeaderFooters property in SectionAdv class. To know more details about adding header and footer please refer to the following API link.

https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SectionAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SectionAdv_HeaderFooters

Also, we have prepared a sample to demonstrate the same. Which can be downloaded from the following link.

https://www.syncfusion.com/downloads/support/forum/151513/ze/RTE_HeaderFooter126215016

Note: On further analysis, currently, we have an issue with adding footer content and suspect this to be a defect. we will validate this and get back to you with more details on 26th February 2020.

Please let us know if you have any questions.

Regards,
Premkumar 



VA Vijayasurya Anandhan Syncfusion Team February 26, 2020 01:34 PM UTC

Hi Naweed,

Thank you for your patience.

We confirmed that the suspected issue with "Footer content" is a defect. We have logged a defect report and planned to include this fix in our upcoming weekly NuGet release which is estimated to be available on 4th March 2020.

Meanwhile, we request to remove the highlighted codes from your sample to avoid the above-reported issue.
Code example:
 
             // Defines the header and footer. 
             HeaderFooters headerFooters = new HeaderFooters(); 
 
            //// Defines the header. 
            //headerFooters.Header = new HeaderFooter(); 
            ParagraphAdv headerParagraph = new ParagraphAdv(); 
            SpanAdv headerSpan = new SpanAdv(); 
            headerSpan.Text = "29 March 2016"; 
            headerParagraph.Inlines.Add(headerSpan); 
            headerFooters.Header.Blocks.Add(headerParagraph); 
 
            // Defines the footer. 
             //headerFooters.Footer = new HeaderFooter(); 
             ParagraphAdv footerParagraph = new ParagraphAdv(); 
             SpanAdv footerSpan = new SpanAdv(); 
             footerSpan.Text = "End of page"; 
             footerParagraph.Inlines.Add(footerSpan); 
             headerFooters.Footer.Blocks.Add(footerParagraph); 
 
            SectionAdv sectionAdv = richTextBoxAdv.Document.Sections[0]; 
            sectionAdv.HeaderFooters = headerFooters; 
            sectionAdv.SectionFormat.HeaderDistance = 50; 
            sectionAdv.SectionFormat.FooterDistance = 50; 

Please let us know if you have any questions.

Regards,
Vijayasurya A
 



NA Naweed Ashraf February 26, 2020 07:13 PM UTC

Bundle of thanks,
Mr. Vijayasurya A 
It is working perfectly.



VA Vijayasurya Anandhan Syncfusion Team February 27, 2020 05:09 AM UTC

Hi Naweed,

Thank you for your update.

We are glad to know that the reported problem gets resolved. As promised earlier, we will include the fix for the reported issue with "Footer content" in our upcoming weekly NuGet release which is estimated to be available on 3rd March 2020

Please let us know if you need further assistance in this. As always, we will be happy to assist you.
 

Regards,
Vijayasurya A
 



NA Naweed Ashraf March 3, 2020 11:39 AM UTC

Hi Sir,
Is it possible to select one complete sentence instead of single word with double click in richTextBoxAdv. Or if it can be done with triple click as in MS word triple click select a paragraph.
Regards


PS Premkumar Sundaramoorthy Syncfusion Team March 3, 2020 01:13 PM UTC

Hi Naweed,

We do not have support to select one complete sentence instead of a single word with double click in SfRichTextBoxAdv. But you can be done this with triple-click as in MS word triple-click select a paragraph.

Please let us know if you need any further assistance.

Regards,
 
Premkumar 


Loader.
Up arrow icon