Opened 2 years ago

Last modified 8 months ago

#13623 confirmed New Feature

Improve copy and paste from Office applications (particularly Excel & Powerpoint)

Reported by: Christophe Guillou Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: IBM Cc: Satya Minnekanti, Irina, giogio, inga

Description

When copying an excel or powerpoint content into CKEditor, rich content is lost.

Customers want to copy it as an embedded object, so that the original content can be edited.

Change History (9)

comment:1 Changed 2 years ago by Piotrek Koszuliński

I made a quick check, because previously (before 4.4.8) there was no chance to improve support for pasting from Excel because there wasn't any more data in the pastebin. So that were browses who would have to improve this.

However, since we switched to clipboard API on Chrome and Firefox on Mac (Firefox on Windows must still use the pastebin because of Firefox bug) there's a chance to do something more. We now can access content that's outside of the <body> element in the data available in the clipboard and styles like font colors and perhaps borders too are kept in the <head> element inside a stylesheet. However, matching selectors would be very tricky, so this perhaps is doable but may be very hard to implement. I'm not sure that the effort is reasonable taking into account that only users of Chrome and Firefox@Mac would feel any difference.

I didn't check Power Point, so I'm not sure if we can do more here.

comment:2 Changed 2 years ago by Jakub Ś

Status: newconfirmed
Version: 4.4.8

We can keep this feature open for future reference. I think it describes briefly what is expected.

Previous ticket for MS Excel support is bug marked as "Won't Fix" (#6465). I think it will be better to have a feature request with appropriate comment.


That said, currently only IE handles content from MS Excel pretty well. Other browsers see raw HTML at best.

From CKEditor point of view there is not much you can do. You can set below code but it will mainly improve pasting from Word and IE.

var editor = CKEDITOR.replace( 'editor1', {				
	extraAllowedContent : 'tags, styles, attributes and classes of your choice',
	pasteFromWordRemoveFontStyles : false,
	pasteFromWordRemoveStyles : false
});

Another reason why I have mentioned above code is because, as someone has noticed, when you paste content from MS Excel first into MS Word and then Copy/Paste it into Editor formatting may be preserved.

I know this is two step process but until browsers provide better support for that type of data, there is nothing we can do.

However, since we switched to clipboard API on Chrome and Firefox on Mac (Firefox on Windows must still use the pastebin because of Firefox bug) there's a chance to do something more.

Actually Google Sheets recognizes styles nicely in Firefox and in Chrome. I'm not sure if they are using Cliboard API but perhaps we could use something similar in CKEditor 4 or CKEditor 5.

Last edited 10 months ago by Jakub Ś (previous) (diff)

comment:3 Changed 23 months ago by Anna Tomanek

Summary: Improve Copy & Paste from Office apps (particularly Excel & Powerpoint)Improve copy and paste from Office applications (particularly Excel & Powerpoint)

comment:4 Changed 18 months ago by Jakub Ś

There is variation of pasting into Excel in IE: #14581

comment:5 Changed 11 months ago by Jakub Ś

Related issue: #14828

comment:6 Changed 11 months ago by Jakub Ś

#16736 was marked as duplicate.

comment:7 Changed 10 months ago by Jakub Ś

#16750 was marked as duplicate.

comment:8 Changed 9 months ago by Jakub Ś

#16806 was marked as duplicate.

comment:9 Changed 8 months ago by Jakub Ś

#16880 was marked as duplicate.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy