Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All,

I am using Rich text editor same like MS-Word everything is working fine but I have one problem in Rich text editor How I can get page No. in this editor same like MS-word. If any one have idea please let me know.
Posted

1 solution

The rich text editor is not like MS-word in that it does not have the notion of pages, it just knows of a block of text.

You can however add page numbers to a PrintDialog :
https://msdn.microsoft.com/en-us/library/system.windows.controls.printdialog%28v=vs.110%29.aspx[^]

http://stackoverflow.com/questions/6792118/printing-a-page-number-in-each-printed-page-in-c-sharp[^]

RichTextBox Printing in C# with WinForms VS2010[^]
 
Share this answer
 
Comments
Rustam Ansari 24-May-15 4:00am    
I have checked all the above link what's you have shared for me, but it's not useful for me. I want to display the Number of pages in Rich Text Editor. I have total Character Count and words count whatever I have written in Rich text box editor. When I click on print option then I have get that all the page number along with data what I have written in Rich text box editor I want to same display page number in editor without clicking on print option.
I am Using Asp.Net, C#, Web based Application
Mehdi Gholam 24-May-15 4:12am    
You did not specify the technology, all the above links are for Windows Forms not ASP.net.

In any case like I said the rich text box does not understand "pages" so you can't.
Rustam Ansari 24-May-15 4:18am    
There is any other way to display the count of total Pages in label. I have words count and character count through by Rich text box through by J-Query, Java-Script, or Ajax any of them.
Frankie-C 24-May-15 8:51am    
To do what you want maybe you need to define what's your page dimension (pixels, cm, inches) than get the chars heights of your text lines in the same format. Scan lines and each time you reach the dimension of the page increase the page count for one more...
You want take your pages count in a pages structure array that hold beginning and ending line for each page...
Rustam Ansari 24-May-15 9:03am    
<%@ Register TagPrefix="RTE" Namespace="RTE" Assembly="RichTextEditor" %>
<RTE:Editor ID="txtEditor" ContentCss="CSS/example.css" runat="server" width="90%" Height="450" />

I am using this Rich Text box Editor. In this editor I can't fire the text_Changed event or OnClick, onblur event is also not working. I checked it same. Please share me some links if you have any solution for this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900