3

I want to provide SaaS in my project.

And I am worried about how to provide a document editor in my website, As a simple document editor is must for my project.

I am able to create a simple one using javascript within an iframe of a page, but still I am unable to make it to be save as pdf or doc!!!

So how to make the formatted text in textarea to get save as a pdf/doc document ?

User97693321
  • 3,336
  • 7
  • 45
  • 69
Amit
  • 31
  • 1
  • 5

1 Answers1

3

If I understand it correctly there are two questions here:

  1. How to show a text editor (WYSIWYG editor) on an html page?
  2. How to save the formatted text as a .pdf or .doc?

Answer to first question:
You can use any of the text editors available and embed it in your JSP:

  1. Open source and free: CK-editor
  2. Kendo-UI editor, Kendo UI Web is free and opensource, not the other components.
  3. Open source and free: TinyMCE

All the above editors can be easily embedded and configured to your needs.

Answer to second question:

  1. Normally the practice is to save the formatted content (i.e. the html-source) as it is in the database and then provide an option to download is as a PDF or word document.
  2. Or else store the content in memory (String) if you want to directly convert the text to any other format.
  3. Which ever option you choose, you would need API to write into different format of files and then give it to the user for download or save it on your server file-system.

Here are some links which might help:

Hope this helps in letting you decide what you want. In case I have not understood your question please care to leave a comment. Thanks.

Community
  • 1
  • 1
Prakash K
  • 11,669
  • 6
  • 51
  • 109
  • hey @Prakash K ... thanks for your attention ...!!! i am newbie for all this ... and yes .. you understand my question correctly ..!!! but i dont want to save whole HTML page !! i just want to save the text from textarea to .pdf and .doc format .... – Amit Sep 10 '12 at 03:44
  • I am not talking about converting the whole HTML page ofcourse that can also be done. Here I am saying, the text in the textarea (if formatted) would contain `html` tags like `

    `, `` (bold), `` (italics), `

      `, `
    • ` etc. So you would need a library to convert this `html` text to `pdf`. Here is another [answer](http://stackoverflow.com/questions/235851/using-itext-to-convert-html-to-pdf) to your second question

    – Prakash K Sep 10 '12 at 05:49
  • @Amit I have edited my answer and have included some more links. Here is another [link](http://pdfcrowd.com/editor/) which I think is what you want and can take a little help from. – Prakash K Sep 10 '12 at 05:56