htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
Luis Loosing images when opening or pasting Word-document


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


kwillems
User

Apr 29, 2004, 12:25 PM

Post #1 of 9 (5436 views)
Shortcut
Luis Loosing images when opening or pasting Word-document Can't Post

Why is it that when i open or paste Word-documents with images in it the images don't appear in HTMLArea? I'm using the Luis version.

Is it possible to import the images as well?


Luis
Veteran

Apr 29, 2004, 7:47 PM

Post #2 of 9 (5432 views)
Shortcut
Re: [kwillems] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

Hi Kwillems:

To preserve the view of your images, add these three lines at the very beginning of function cleanHTML(unclean):

unclean = unclean.replace(/<v\:imagedata/gi, "<IMG");
unclean = unclean.replace(/<\/v:imagedata>/gi, "");
unclean = unclean.replace(/o:title/gi, "title");

Be aware that your images will appear in their native size, meaning that if they were resized manually in the Word document, they will appear as before they were resized.

Be also aware that images are stored locally and you will still need to upload the images to the server to make them visible online, otherwise they will appear as not-found images, regardless you see them into the editor.


Greetings


Don't give up!!
http://webstationone.com/test/htmlarea


kwillems
User

May 1, 2004, 2:55 AM

Post #3 of 9 (5406 views)
Shortcut
Re: [Luis] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

Luis, thank you very much!

The problem is, the last weeks i made so much changes to editor.js, that it won't work. I will have a better look at it this weekend.


kwillems
User

May 16, 2004, 3:21 PM

Post #4 of 9 (5319 views)
Shortcut
Re: [kwillems] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

Things work fine now. The problem was caused because i disabled the 'automatic' Wordcleaner. Instead, I inserted a special button for Word-cleaning. Since those three lines are part of the claenhtml-function they initially didn't work.

Now i'm trying to make a little PHP-script, that wil convert the data in the SRC-tag and upload the image when saving the content of the editor-field. That shouldn't be that hard.


(This post was edited by kwillems on May 19, 2004, 4:59 PM)


kwillems
User

May 19, 2004, 5:00 PM

Post #5 of 9 (5278 views)
Shortcut
Re: [kwillems] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

I've got it working!

I made myself a PHP-script which reads the src-tag of the document and if neccessary changes it. Furthermore it uploads the image to the server, resizing it to the desired size (using the GD-library).

Im still figuring out some 'word-wrapping functions' of MS Word to preserve the original layout of the document, but that's only a minor 'problem'.


(This post was edited by kwillems on May 19, 2004, 5:01 PM)


Luis
Veteran

May 19, 2004, 10:59 PM

Post #6 of 9 (5271 views)
Shortcut
Re: [kwillems] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

Hi Kwillems:

I'd love to take a look to your function if you will to share it.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea


kwillems
User

May 20, 2004, 4:24 AM

Post #7 of 9 (5248 views)
Shortcut
Re: [Luis] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

Of course i will share it.

The routine i make so far is part of a CMS i'm making for some collegues of me. I can try to justify the code so i can be used by others too. But be aware, i'm not a professional scripter.

I'll contact you when i've finished the script, ok?


jstander
New User

Jul 14, 2004, 12:00 PM

Post #8 of 9 (4752 views)
Shortcut
Re: [kwillems] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

I would also be very interested in seeing the script. Have you finished it? Is it published somewhere in the forum?


kwillems
User

Jul 14, 2004, 12:06 PM

Post #9 of 9 (4747 views)
Shortcut
Re: [jstander] Luis Loosing images when opening or pasting Word-document [In reply to] Can't Post

I've posted it here: http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v2.0_-_Add-Ons_F19/HTML_MS_Word_Cleaner_P19639/

But ...
i'm working on a real internetserver now for a couple of weeks, and to my big disapointment i discovered the ftp-routine i had in mind won't work. So, the uploading part of the script has to be rewritten.
In fact, thinking about the way i planned to make it work, that would be a giant security risk, since remote servers could easily upload files from ones harddisk when this would be possible.

So, i have to rewrite that part of the script into a user friendly 'handmade' upload of the images.

I'm sorry.

 
 
 


Search for (options)