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

XML Schema Settings - Space Lexems??

Hi,
I am doing an html viewer using the Edit Control and WebBrowser control.
I have the schema correct for the Music Lyric Chords program I am making.
See attached
I want to display the chords in the exact place I put them in the source editor.
But, when I preview in html viewer, as you know.
Html only allows one space between character unless you use the ' ' code.
Q: How do I setup a lexem/split so that a space automatically inserts the ' ' code (unseen from user)
This way, when I do print preview the chords will stay where I put them.
Do able??

Attachment: lyriceditor01_9f9f7fb0.zip

6 Replies

MK Mallika Kannan Syncfusion Team July 10, 2017 02:55 PM UTC

  
Hi Frank 
 
Thank you for contacting Syncfusion support. 
 
At present there is no default support to achieve this reported requirement and also this requirement is not related with Lexem/ Split features in EditControl. So we have achieved this reported requirement by work around 
 
Please make use of the below Code snippet. 
 
Code snippet 
 
//Refresh the File conten 
if (File.Exists(BasePath)) 
{ 
                File.Delete(BasePath); 
} 
//Load the file Content 
for (int i = 0; i < this.editControl1.Lines.Length; i++) 
{ 
                string line = this.editControl1.Lines[i].Replace(" ","&nbsp;&nbsp;"); 
                StreamWriter writer = new StreamWriter(BasePath, true); 
                writer.WriteLine(line); 
                writer.Close(); 
} 
//Load the Html file 
this.htmluiControl1.LoadHTML(BasePath); 
 
Screenshot 
 

 
We have prepared the sample and video for your reference. It can be downloaded from the below link, 
 
 
 
Kindly check with above and let us know if it helpful. 
 
Regards, 
Mallika 
 



FH Frank Hilton July 10, 2017 02:59 PM UTC

I will check it out later... looks promising.

I will let you know!



FH Frank Hilton July 10, 2017 04:24 PM UTC

The code you supplied worked as far as what it does... replace the spaces.

However, because of html technology itself, the chords are off from what they look like on the screen (in the editor).

So, this won't work.

I would use the default PrintPreview of .NET, but the toolbar looks ugly.

Even though that does work... I was hoping I could print preview on the PrintPreview Control, but it doesn't print in color because you have to specify the brush color.

And that would mean I would have to write code and parse the entire thing for just a color print out.


Thanks for you efforts!!



FH Frank Hilton July 11, 2017 10:09 PM UTC

Attached are 2 screenshots. I will explain each one.

#01
Shows the edit control printed in full color using the >NET default PrintPreviewDialog.
However, the tool bar is ugly and I can't edit it.

#2
This is the output of the Edit control using the PrintPreviewControl
However, none of the chords are in RED.

Is there anyway to get the PrintPreviewControl to print whatever colors there are in the edit control??

If this can't be done....

Can outputting the Edit control content unto your PDF control work??
Maybe I can use the PDF as a Print Preview.


Attachment: PrintPreviewColor_e6912310.zip


FH Frank Hilton July 12, 2017 01:21 AM UTC

Hello..... I GOT IT!!!

I dug into the PDF examples and had to tweak the code a little, but the PDF prints the Edit Control content PERFECT!!!

THANKS YOU!!!



MK Mallika Kannan Syncfusion Team July 12, 2017 06:56 AM UTC

  
Hi Frank 
 
Thanks for your update. 
 
We are glad that we have helped you on this and please let us know if you need any further assistance. 
 
Regards, 
Mallika 


Loader.
Up arrow icon