Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pasting structures copied from ChemDraw OLE objects #3689

Closed
vanoprenko opened this issue Dec 11, 2023 · 3 comments
Closed

Support pasting structures copied from ChemDraw OLE objects #3689

vanoprenko opened this issue Dec 11, 2023 · 3 comments

Comments

@vanoprenko
Copy link
Collaborator

Background
Chemical structures are often embedded into MS Office applications using ChemDraw OLE objects. In order to view and edit these structures in Ketcher users need to be able to copy a structure from ChemDraw OLE object to clipboard and paste it to Ketcher.

Solution
When copying to clipboard is applied to a ChemDraw OLE object, it stores underlying chemical structure in 'Native' clipboard item in CDX (binary) format. Structure/CDX content starts with a 8-byte header:
"VjCD0100" (56 6A 43 44 30 31 30 30)

When user tries to paste clipboard content into Ketcher, the following algorithm should be applied:

  1. Check if 'Native' item is available in the clipboard and its content includes CDX header.
  2. If CDX content is detected, extract it from the item (How to find the end of CDX is TBC)
  3. Convert resulting CDX content into structure and display it on canvas using regular approach for pasting CDX data from clipboard.
@AlexeyGirin
Copy link
Collaborator

AlexeyGirin commented Dec 13, 2023

Stopped for a while since not clear how to implement it.

Action points:

  1. Send email to the customer
  2. Investigate if we are able to create POC on C# (.NET)

@vanoprenko
Copy link
Collaborator Author

It appeared that browser, due to its security limitations (?) doesn't allow reading binary data with CDX from the clipboard. Alternative options are:

  • develop a desktop app that would monitor clipboard and repack CDX data into another field accessible from browser
  • develop a desktop app that would extract and save on disk all CDX drawings (in batch mode)
  • introduce a pptx browsing UI in Ketcher that would allow extracting CDX objects from pptx and adding them to canvas (i.e. avoid dealing with clipboard
    Decided to proceed with the last option. Replaced with Add support for opening structures in CDX format embedded into MS PowerPoint #3914

@vanoprenko
Copy link
Collaborator Author

Won't do

@vanoprenko vanoprenko closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
@AlexeyGirin AlexeyGirin removed this from the Query Features - Phase II milestone Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants