- Home
- Forum
- JavaScript - EJ 2
- Copy Paste issue
Copy Paste issue
An editor is having issue copying for web pages and it is giving an error somewhat "attribute is not declared" like as below

Please help to fix.
SIGN IN To post a reply.
13 Replies
SM
Suriya Murugan
Syncfusion Team
August 19, 2019 10:54 AM UTC
Hi Kundan,
Thank you for contacting the Syncfusion support.
Can you please refer the below link to create the controller for SystemClipboard?
https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices/blob/master/src/Controllers/DocumentEditorController.cs
If you still facing issue, could you please share your WebAPI project? So that we can investigate further validate and provide you solution at earliest.
If you still facing issue, could you please share your WebAPI project? So that we can investigate further validate and provide you solution at earliest.
Regards,
Suriya M.
KU
Kundan
August 20, 2019 03:15 PM UTC
Hi Suriya
The code I am using is quite similar but it is referencing different "WordDocumentObject" under "Syncfusion.EJ2.DocumentEditor" namespace.
I have attached the controller file as requested to check.
Attachment: DocumentEditorController_5608c5a7.zip
The code I am using is quite similar but it is referencing different "WordDocumentObject" under "Syncfusion.EJ2.DocumentEditor" namespace.
I have attached the controller file as requested to check.
Attachment: DocumentEditorController_5608c5a7.zip
SM
Suriya Murugan
Syncfusion Team
August 21, 2019 10:43 AM UTC
Hi Kundan,
Thanks for sharing the information.
In your controller file for importSystemClipboard, you are using WordDocument.Load method. You can change the code like below and then try running sample.
|
WordDocument document = WordDocument.LoadString(param.content, GetFormatType(param.type.ToLower()));
string json = Newtonsoft.Json.JsonConvert.SerializeObject(document);
document.Dispose();
return json; |
You can load the string directly using WordDocument.LoadString method.
Regards,
Suriya M.
KU
Kundan
August 21, 2019 05:22 PM UTC
I tried as per your suggestion but it is still not working and giving error as below

I am trying to copy-paste content from a website
specifically HTML table content
Hope this helps
I am trying to copy-paste content from a website
specifically HTML table content
Hope this helps
SM
Suriya Murugan
Syncfusion Team
August 22, 2019 10:38 AM UTC
Hi Kundan,
To paste, copied content from browser(html content), we are using Syncfusion DocIO library.
It supports only the HTML files that meets the validation either against XHTML 1.0 strict or XHTML 1.0 Transitional schema.
From provided screenshot, we can able to confirm the issue because of html content does not meet validation. So, only error thrown. However, in client side, we have handled the code to convert the html content to welformatted xhtml content.
Can you please share the copied html content which thrown error? So that we can investigate further and provide you solution at earliest.
Regards,
Suriya M.
KU
Kundan
August 22, 2019 05:17 PM UTC
I feel the issue is with every dynamic HTML content but you can check for the content as below
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>
<table class="table dataTable no-footer dtr-inline collapsed" id="gvPatientDetails" role="grid" aria-describedby="gvPatientDetails_info" style="box-sizing: content-box; border-collapse: collapse; border-spacing: 0px; max-width: 100%; background-color: rgb(255, 255, 255); width: 1232.67px; margin: 0px auto; clear: both; border-bottom: none; color: rgb(51, 51, 51); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; table-layout: fixed; overflow-wrap: break-word; height: 350px;"><tbody style="box-sizing: border-box;"><tr data-patientid="1427" role="row" class="odd" style="box-sizing: border-box; background-color: rgb(255, 255, 255);"><td style="box-sizing: content-box; padding: 8px 10px; line-height: 1.42857; vertical-align: top; border-top: 1px solid rgb(221, 221, 221);">1</td><td style="box-sizing: content-box; padding: 8px 10px; line-height: 1.42857; vertical-align: top; border-top: 1px solid rgb(221, 221, 221);">26/07/2019 20:31:30</td><td style="box-sizing: content-box; padding: 8px 10px; line-height: 1.42857; vertical-align: top; border-top: 1px solid rgb(221, 221, 221);">Maa Mahamaya Hospital</td></tr></tbody></table>
</body></html>
SM
Suriya Murugan
Syncfusion Team
August 23, 2019 01:59 PM UTC
Hi Kundan,
Thanks for sharing the content.
We have tried to reproduce the issue by following steps:
1. Copied the provided html content and paste it in html file.
2. Opened the html file in browser.
3. Then copied the table and paste it in DocumentEditor.
Table gets pasted without any script error.
Regards,
Suriya M.
KU
Kundan
August 23, 2019 02:25 PM UTC
Hi Suriya
I tried the steps that you followed but I am getting the same error.
Not sure how your code is different from mine.
Can you please a sample of your code razor MVC to me?
Thanks.
Not sure how your code is different from mine.
Can you please a sample of your code razor MVC to me?
Thanks.
SM
Suriya Murugan
Syncfusion Team
August 27, 2019 06:09 PM UTC
Hi Kundan,
As mentioned earlier, to paste the copied content from browser(html content), we are using Syncfusion DocIO library.
It supports only the HTML files that meets the validation either against XHTML 1.0 strict or XHTML 1.0 Transitional schema.
To validate input html, we are using IsValidXHTML method. If provided html is supported format, it will allow to paste.
Please check the sample of WebAPI in MVC in below link:
Regards,
Suriya M.
KU
Kundan
August 31, 2019 10:44 AM UTC
Hi Suriya
Even your sample does not work for copying mixed content from web pages.
It seems there is something I am missing at page client-side JS or Syncfusion do not support copying content from the web page if the copied content is having custom attributes.
I would request to have a meeting if you are still not able to replicate the issue.
Thanks.
Kundan
Even your sample does not work for copying mixed content from web pages.
It seems there is something I am missing at page client-side JS or Syncfusion do not support copying content from the web page if the copied content is having custom attributes.
I would request to have a meeting if you are still not able to replicate the issue.
Thanks.
Kundan
SM
Suriya Murugan
Syncfusion Team
September 2, 2019 09:36 AM UTC
Hi Kundan,
We have created new incident under your account, we have further follow-up on the newly created incident regarding this issue.
Regards,
Suriya M.
KU
Kundan
March 7, 2020 09:22 AM UTC
Hi Support
Please advise a time for a meeting for the same.
We are still not able to fix the issue.
Thanks.
Kundan
Please advise a time for a meeting for the same.
We are still not able to fix the issue.
Thanks.
Kundan
HC
Harini Chellappa
Syncfusion Team
March 9, 2020 01:16 PM UTC
Hi Kundan,
We have reopened the incident which we have created under your direct trac account. We have updated the response for your query in that incident. Kindly check it.
Regards,
Harini C
SIGN IN To post a reply.
- 13 Replies
- 3 Participants
-
KU Kundan
- Aug 15, 2019 05:25 PM UTC
- Mar 9, 2020 01:16 PM UTC