I am making a file uploader and editer in PHP using the TinyMCE rich text editor.
Which all files/types can be edited in TinyMCE.
Whats best was to edit a server file in TinyMCE.
How do i save to file edited in TinyMCe and what format should i save.
Sample code will be helpful.
In case tinymce is not right editor, please just another open source rich text editor.
TinyMCE is just a WYSIWYG editor which means that it cannot read or write content to files, but it can interpret html to visual texts.
You can exchange html between TinyMCE and you php code then write it as you want into files.
You can use some APIS to convert your files content into HTML to read it, these are some links to read write MS Word Content
How can I display Word documents in a textarea using PHP?
Create Word Document using PHP in Linux
Regards
NiL
Related
I'm a little confused about PHPWord w/ DomPDF. If I generate HTML using Laravel/PHP/Blade, store it in a text file saving it with .html extension, and open it with Word (open Word, select File open, etc), I see the page as I would like to see it in Word.
But if I use PHPWord to write the HTML to a file and then open it as Word2007 for download, PHPWord strips out all the CSS etc. And it looks horrible.
Also while dompdf with the help of PHPWord (again writing the HTML to a file and being read as PDF) the PDF looks much better than the generated Word version but still has no styling.
I have reviewed the samples for each . . . all the articles I can find on here etc. Is there another way to do what I do manually--open the html in Word--for a download with PHP?
I cannot recode the blade template with the PHPWord tagging. But if the Windows laptop Word app can open my HTML and save it as a Word file just fine I would think I could do this relatively easily with PHP programmatically somehow.
I use the tinyMCE editor, I save its data with mysql, in html from what I can see.
How can I export this data of my users to pdf and docx with php (serverside) ?
I believe the free edition of phpDocx lacks that functionality (embedHTML function missing)
Is there an alternative ?
You should write your html code to a html file serverside and use a library like this one to create a pdf file.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
javascript WYSIWYG HTML editors?
Im not quite sure how to put this as i dont know what its called. But essentially what i need is a textarea like the one on stack overflow with a Bold button where you highlight text, or bullet points etc and I have heard there are some good open source ones.
I have a database with php going into it from a plain text area, i just need to be able to do extra features.
Many thanks!
From another thread where I posted the same answer:
There are many to choose from. Among the most popular are:
Aloha Editor - Open Source browser based html5 enabled rich text
editor.
CKEditor - Open Source browser based rich text editor.
TinyMCE - Open Source editor control.
WYMeditor - Open Source XHTML editor focusing on semantic markup.
Dijit Editor - a Dojo-based rich text editor component.
YUI Rich Text Editor - a Yahoo! rich text editor component.
KindEditor - Open Source HTML editor.
Source: http://en.wikipedia.org/wiki/Rich-text_editor
I personally use http://ckeditor.com/ for most things, since you can customize it to meet your demands with relative ease, and dispite many WYSIWYG editors it actually handles the generated HTML quite well.
For the textarea to receive and send off data, you will need to consult the documentation for the WYSIWYG editor you are using, since it varies from editor to editor, how you manipulate, set and get data.
You will need to output the HTML with PHP like this:
echo htmlspecialchars($database_stuff["content"]);
Then the otuputted content will not be parsed by the browser (but by the WYSIWYG editor - if parsed at all).
I want users to write HTML code, so they could format text and I could put that into database. I want users to be able to make lists, bold text, italic and I guess that's it. Thanks.
You should use ckeditor.
CKEditor is a text editor to be used inside web pages. It's a WYSIWYG editor, which means that the text being edited on it looks as similar as possible to the results users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word and OpenOffice.
for replacing all text area with html editor refer below link.
http://svn.ckeditor.com/CKEditor/trunk/_samples/php/replaceall.php
I just recently implemented Chipersoft's version of WYSIWYG Markdown Editor, works much like Stackoverflow's markdown editor.
You can save the markdown version in your database, then when you want to render it, you can use PHP Markdown to convert it from marked down to actual HTML tags.
These two apps work great together, and means less of a footprint in your database (and on filesystem), because you are not having to store the full blown html tags.
Markdown Editor: https://github.com/ChiperSoft/wmd
Markdown to HTML Converter: http://michelf.com/projects/php-markdown/
I am trying to parse a word document file. I upload the using PHP then I am trying to get contents using file_get_contents(); function but the problem is when its displayed in front end a lots of garbage code in there like
Æ�Ѐ¤d�¤d�[$\$gd®l±����„h¤d�¤d�[$\$^„hgd®l±���
&�F�¤d�¤d�[$\$gd3¡���gd3¡����„,¤d�¤d�[$\$^„,gd(E����¤d�¤d�[$\$gdÿ/��<��C��D��I��Å������O��P��‚��¡��¢��¬����®��Ù��ã��ó��ô�����
So my question is how can I clean up this text?
Maybe give this a shot? http://www.phpclasses.org/package/3553-PHP-Edit-Microsoft-Word-documents-using-COM-objects.html
Word documents (like docx and doc) are not straight text files - they are actually proprietary file types that do not just have the text from byte 0 - this is how they have fancy formatting and fonts. .docx files are actually archives (.zip files) that contain a myriad of XML and styles.
Your best bet is to use a text input form, or find code online that allows you to extract just the text. Or, download the doc files to your own computer and use your own copy of MS word to open it.