NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
madroadbiker
Joined: 29 Apr 2012 Posts: 6
|
Posted: Sun May 06, 2012 7:36 pm Post subject: How to write to a file including character attributes |
|
|
I have an application which has two text panes. The user can enter text into the text panes with attributes like underline, bold, italics, subscript, and superscript and it all looks fine in the text panes. I enable the user to save the contents of the text pane into a file in either plain text, pdf, or xml. I am using iText for the pdf output and java.beans XMLEncoder for xml output. Neither format saves the character attributes. They both save in plain text.
Here is how I am trying to save in xml format (contentWindow is a textPane):
| Code: |
XMLEncoder encoder =
new XMLEncoder(
new BufferedOutputStream(
new FileOutputStream(fileName)));
encoder.writeObject(contentWindow.getText());
encoder.close();
|
What am I doing wrong? |
|
| Back to top |
|
 |
emi
Joined: 14 Aug 2009 Posts: 154
|
Posted: Mon May 07, 2012 5:32 am Post subject: Re: How to write to a file including character attributes |
|
|
This is the wrong mailing list to ask such a question. nbdev@ is only used if you are developing the IDE/Platform itself. nbusers@ is for general questions.
That being said, the problem seems to be that you are using |
|
| Back to top |
|
 |
madroadbiker
Joined: 29 Apr 2012 Posts: 6
|
Posted: Wed May 09, 2012 11:32 pm Post subject: Re: How to write to a file including character attributes |
|
|
| emi wrote: | This is the wrong mailing list to ask such a question. nbdev@ is only used if you are developing the IDE/Platform itself. nbusers@ is for general questions.
That being said, the problem seems to be that you are using |
Sorry for posting in the wrong forum. I would move this thread if I could.
Anyway, where's the rest of your response? Sounds like it would help. |
|
| Back to top |
|
 |
emi
Joined: 14 Aug 2009 Posts: 154
|
Posted: Fri May 11, 2012 6:15 am Post subject: Re: How to write to a file including character attributes |
|
|
| You email client has problems. Here's the online archive: |
|
| Back to top |
|
 |
madroadbiker
Joined: 29 Apr 2012 Posts: 6
|
Posted: Sat May 12, 2012 12:31 pm Post subject: Re: How to write to a file including character attributes |
|
|
| emi wrote: | | You email client has problems. Here's the online archive: |
I don't know what's going on but again it looks like your message has been cut off. What archive? Why do you think my email client has problems? What does this have to do with my original question? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|