Opened 21 months ago

Last modified 7 weeks ago

#13623 confirmed New Feature

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

Reported by: cguillou Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: IBM Cc: satya, 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 21 months ago by Reinmar

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 21 months ago by j.swiderski

  • Status changed from new to confirmed
  • Version 4.4.8 deleted

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 4 months ago by j.swiderski (previous) (diff)

comment:3 Changed 17 months ago by Anna

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

comment:4 Changed 12 months ago by j.swiderski

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

comment:5 Changed 5 months ago by j.swiderski

Related issue: #14828

comment:6 Changed 5 months ago by j.swiderski

#16736 was marked as duplicate.

comment:7 Changed 4 months ago by j.swiderski

#16750 was marked as duplicate.

comment:8 Changed 3 months ago by j.swiderski

#16806 was marked as duplicate.

comment:9 Changed 7 weeks ago by j.swiderski

#16880 was marked as duplicate.

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