BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.67k stars 1.85k forks source link

Copy Paste Page with Multiple Images #449

Open s0n- opened 7 years ago

s0n- commented 7 years ago

For Feature Requests

Desired Feature: When Copy pasting pages or word documents, images do not paste over, only text. Images have to be copied one by one.

https://github.com/BookStackApp/BookStack/search?utf8=%E2%9C%93&q=paste+images&type=

Here I see there is some javascript that sets enable data paste to false, could this be a setting to fix it?

For Bug Reports

Expected Behavior

Entire documents paste with multiple images

Actual Behavior

Only text pastes

s0n- commented 7 years ago

I have tested with the latest version .17.4 and multiple image pasting does not work as well.

s0n- commented 7 years ago

Changing that to true on that page worked and now I can paste multiple images

Closing and leaving comment

s0n- commented 7 years ago

This did not fix the issue, it was a user error and I was copy pasting images from a website so it took it pointed to the URLS.

I can do this in other platforms, not sure why it wont work here.

ssddanbrown commented 7 years ago

@s0n- There's code built in to specifically handle image paste, It's not an in-built feature of browsers or anything, So It's likely the code needs to be updated to handle this.

I'd prefer to leave data paste disabled as It can make pages extremely large since images become embedded in the HTML of the page.

paraiciam commented 7 years ago

I would really like to add my support for this enhancement. The beauty of enabling this is that migration from multiple Word doc repos is made so much easier. We have hundreds of Word docs we would love to migrate to Bookstack and this feature is holding us back. Otherwise great app.

paraiciam commented 7 years ago

Or maybe you can allow a configurable setting for those who do want it.

s0n- commented 6 years ago

Just wanted to come back and touch on this request. Migrating from word documents or other sites is tedious and holding back my team from fully committing to bookstack.

paraiciam commented 6 years ago

Any feedback on this request?

s0n- commented 6 years ago

yeah, i think this is super important to create pages from other docs..

Beinish commented 6 years ago

Did you find a solution to this?

s0n- commented 6 years ago

I did not, it is rather frustrating creating and migrating docs into Bookstack. It is definitely the largest hurdle I face getting the team completely bought in.

paraiciam commented 6 years ago

Hi yeah I agree. It is a killer missing feature. We will probably drop it for now until it gets fixed.

Rgds Paraic

On Tue, Jan 9, 2018 at 2:44 PM, s0n- notifications@github.com wrote:

I did not, it is rather frustrating creating and migrating docs into Bookstack. It is definitely the largest hurdle I face getting the team completely bought in.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BookStackApp/BookStack/issues/449#issuecomment-356303497, or mute the thread https://github.com/notifications/unsubscribe-auth/APv0tUvPstBMosm3zLEGLMtbYOBvvawfks5tI3tJgaJpZM4Oh8kI .

Abijeet commented 6 years ago

Can you guys give a sample doc file? I put images in a doc file and pasted it, and it works as expected but then I'm on a Linux machine.

Beinish commented 6 years ago

I installed the app using the script for Ubuntu. I have MHT, word, rich text files with text and images in them and it just won't work no matter what I try. So really any doc wouldn't work for me. Should I try to reinstall it or something?

ptitboogy commented 6 years ago

Hello,

I also have the same behaviour. I did a lot of test : OS : Windows 7 and Windows 10 Browser : IE, Edge and Firefox Source copy : Microsoft Word 2016, LibreOffice, MHTML file opened from Edge. Each time, the images are not copied to BookStack. As the other people, this problem is blocking us to migrate from our current documentation repository to Bookstack.

Regards,

paraiciam commented 6 years ago

Hi I just did a test and have the same result - I click Ctrl-A and copy all content and then do a Paste in a New Page and only text gets transferred. Word 2013 and Word 2010 with latest bookstack. I can individually copy each image in a doc file and that will paste fine and no problems pasting.

Copying from a html page with images is hit and miss - some images copy but the page is not well formatted.

Paraic

On Thu, Jan 11, 2018 at 10:42 AM, ptitboogy notifications@github.com wrote:

Hello,

I also have the same behaviour. I did a lot of test : OS : Windows 7 and Windows 10 Browser : IE, Edge and Firefox Source copy : Microsoft Word 2016, LibreOffice, MHTML file opened from Edge. Each time, the image are not copied to BookStack. As the other people, this problem is blocking us to migrate from our current documentation repository to Bookstack.

Regards,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BookStackApp/BookStack/issues/449#issuecomment-356896213, or mute the thread https://github.com/notifications/unsubscribe-auth/APv0tdd4e_Duh9Qt3Ic4dVyw2xzdHX3jks5tJeWvgaJpZM4Oh8kI .

paraiciam commented 6 years ago

Some text.docx

Sample file attached which is not working. On ly the words "Some text" get copied. The images can be copied afterwards by selecting them one by one and pasting them in.

Paraic

Abijeet commented 6 years ago

I unfortunately do not have access to MS-Office. I'm unable to reproduce this using LibreOffice. When I try to copy from Google Drive, I do see an error.

screenshot-2018-1-15 edit page draft bookstack

Are you guys seeing that error when you try to upload?

@ssddanbrown - If they are not getting an error, my guess would be with this line of code,

https://github.com/BookStackApp/BookStack/blob/5b075aa9bd6ab660fc67bf630a4d1def758df99f/resources/assets/js/pages/page-form.js#L14

I guess the way we are checking for image files may need to be tweaked.

paraiciam commented 6 years ago

Hi Abijeet No I don't see an error when pasting - it just ignores the images and pastes the text..

Rgds Paraic

On Mon, Jan 15, 2018 at 4:22 PM, Abijeet Patro notifications@github.com wrote:

I unfortunately do not have access to MS-Office. I'm unable to reproduce this using LibreOffice. When I try to copy from Google Drive, I do see an error.

[image: screenshot-2018-1-15 edit page draft bookstack] https://user-images.githubusercontent.com/1685517/34951926-f0ddf9ca-fa3d-11e7-8991-964fa3bb6226.png

Are you guys seeing that error when you try to upload?

@ssddanbrown https://github.com/ssddanbrown - If they are not getting an error, my guess would be with this line of code,

https://github.com/BookStackApp/BookStack/blob/ 5b075aa9bd6ab660fc67bf630a4d1def758df99f/resources/assets/ js/pages/page-form.js#L14

I guess the way we are checking for image files may need to be tweaked.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BookStackApp/BookStack/issues/449#issuecomment-357729329, or mute the thread https://github.com/notifications/unsubscribe-auth/APv0te4d_-9CfzeaE5V14-Y6GX14mSD2ks5tK3tZgaJpZM4Oh8kI .

Beinish commented 6 years ago

I also do not see an error. The images simply do not paste. Tried MHTML, word, rich text.

ssddanbrown commented 6 years ago

@Abijeet Don't think it's necessarily that line of code. That simply skips past non-image clipboard data since the code below it is only for images.

I've had a play about with this. For reference I'm using LibreOffice on Ubuntu 17.10 and chrome for testing.

Upon paste, the data is exposed to JavaScript in three formats:

  1. Plain text - Only contains the copied text and whitespace with no additional structure or formatting.
  2. HTML - Contains the text content and layout structure but images are stripped from the data.
  3. RTF - Contains contains the image data and text content.

So RTF contains the data but is the most awkward format to process to get the target HTML output. Parsing the RTF data will be a tricky task and there's not many mature RTF to HTML libraries out there.

Even then, this may be different on word and other browsers may handle this differently, RTF is not a required format in the ClipboardAPI spec so other browsers may not expose this, Will need to check.

Think there's a reason why TinyMCE has advanced word-pasting as a premium plugin. That said, From their plugin demo the same output occurred, No images.

paraiciam commented 6 years ago

thanks for the update Dan. Will this be flagged an an upcoming feature? It would be a gamechanger for sure for html editors to have this feature.

paraic

Abijeet commented 6 years ago

Hey @ssddanbrown,

The reason I thought that line might need to change is because when copy pasting from Google Docs, the type for images was reported as application/x-vnd.google-docs-image-clip+wrapped but items[i].getAsFile(); returned null which caused that error to appear.

Since copy pasting from doc file copy was not triggering an error for the others, I figured that we could try tweaking the type to see if we were able to extract the image from it.

Beinish commented 6 years ago

Hey guys, any update on this issue?

ssddanbrown commented 6 years ago

No, Not really. Blocked by being a technically very difficult.

There is a new browser ClipBoard API in draft that will start to be implemented in browsers soon but no guarantees this will make things easier.

Zyzto commented 3 years ago

is there any update regarding this as all editors on web browsers can do this.

ssddanbrown commented 3 years ago

is there any update regarding this as all editors on web browsers can do this.

No update, have not spent time re-checking the state of this since. Any insight or examples would be appreciated.

Zyzto commented 3 years ago

is there any update regarding this as all editors on web browsers can do this.

No update, have not spent time re-checking the state of this since. Any insight or examples would be appreciated.

I see bookstack using tinyMCE there's' plugin powerPaste it's premium ik, do they not provide free license for opensource projects? there's CKEditor that provide that : https://ckeditor.com/wysiwyg-editor-open-source/index.html

kirillnad commented 3 years ago

Paid plugin for TinyMCE "Paste from Word": https://www.tiny.cloud/docs-4x/enterprise/paste-from-word/

EvoXCX commented 3 months ago

Issue still open since 2017 no progress on this side ?

It's a basic feature (basic doesn't mean easy to setup), so it's very tedious to migrate documentation to Bookstack. Is there plan to support this feature or this is a "abandoned issue" ?

Thanks 😄

ssddanbrown commented 3 months ago

@EvoXCX No, I personally haven't dug back into this since my previous comments above. If you're mainly working with docx files then this hack may help during the migration process: https://www.bookstackapp.com/hacks/wysiwyg-docx-import/

spoonerarthur commented 2 months ago

I'm searching for a OpenSource Wiki and found BookStack. At the moment I have a OneNote 2016 Wiki in local Database / notebook. I can export the notebook to MHT Files. Is it possible to import this files to BookStack?