Smart Paste for DOCX graphics
Posted: Sat Nov 16, 2019 1:37 am
Hello,
We're attempting to use the Smart Paste functionality to be able to copy/paste graphics into XML documents utilizing a custom AuthorExternalObjectInsertionHandler with our framework. We are trying to embed the image data into the href attribute instead of inserting a reference to the graphic.
If we copy/paste from a .doc file, the AuthorExternalObjectInsertionHandler is invoked, and we could conceivably use this to grab the binary data and embed it into the href attribute. However, pasting from a .docx file does not invoke the AuthorExternalObjectInsertionHandler. The reason for this is likely that the Windows clipboard doesn't contain a "HTML Format" rendition of the content. Instead, oXygen prompts the user to save the graphic data to a file, then inserts a reference to the newly created image file. That's helpful, but it's preventing us from embedding the image data during a paste operation from .docx.
The question is: Is there a way to prevent the "Save As" behavior in oXygen when raw image data is pasted into the editor, and instead handle it another way? If so, we could attempt to embed the image data during a paste from .docx.
Thanks!
We're attempting to use the Smart Paste functionality to be able to copy/paste graphics into XML documents utilizing a custom AuthorExternalObjectInsertionHandler with our framework. We are trying to embed the image data into the href attribute instead of inserting a reference to the graphic.
If we copy/paste from a .doc file, the AuthorExternalObjectInsertionHandler is invoked, and we could conceivably use this to grab the binary data and embed it into the href attribute. However, pasting from a .docx file does not invoke the AuthorExternalObjectInsertionHandler. The reason for this is likely that the Windows clipboard doesn't contain a "HTML Format" rendition of the content. Instead, oXygen prompts the user to save the graphic data to a file, then inserts a reference to the newly created image file. That's helpful, but it's preventing us from embedding the image data during a paste operation from .docx.
The question is: Is there a way to prevent the "Save As" behavior in oXygen when raw image data is pasted into the editor, and instead handle it another way? If so, we could attempt to embed the image data during a paste from .docx.
Thanks!