We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

open function issue

Thread ID:

Created:

Updated:

Platform:

Replies:

145295 Jun 16,2019 05:50 PM UTC Jun 18,2019 05:23 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: DocumentEditor
Kundan
Asked On June 16, 2019 05:50 PM UTC

open function is giving error "Unexpected token in JSON" when the data contains a tab character

EX: 
documenteditor.open('{"sections":[{"sectionFormat":{"pageWidth":612,"pageHeight":792,"leftMargin":72,"rightMargin":72,"topMargin":72,"bottomMargin":72,"differentFirstPage":false,"differentOddAndEvenPages":false,"headerDistance":36,"footerDistance":36,"bidi":false},"blocks":[{"paragraphFormat":{"styleName":"Normal","listFormat":{}},"characterFormat":{},"inlines":[{"characterFormat":{"bidi":false},"text":"This is test report"}]},{"paragraphFormat":{"styleName":"Normal","listFormat":{}},"characterFormat":{},"inlines":[{"characterFormat":{"bidi":false},"text":"by"},{"characterFormat":{"bidi":false},"text":"\t"},{"characterFormat":{"bidi":false},"text":"gvgj"},{"characterFormat":{"bidi":false},"text":"kundan"}]}],"headersFooters":{}}],"characterFormat":{"bold":false,"italic":false,"fontSize":11,"fontFamily":"Calibri","underline":"None","strikethrough":"None","baselineAlignment":"Normal","highlightColor":"NoColor","fontColor":"#000000","fontSizeBidi":11,"fontFamilyBidi":"Calibri"},"paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":0,"afterSpacing":0,"lineSpacing":1,"lineSpacingType":"Multiple","listFormat":{},"bidi":false},"defaultTabWidth":36,"styles":[],"lists":[],"abstractLists":[]}');

Please help. My editor is stuck. Don't know what to do.

Ramya Thirugnanam [Syncfusion]
Replied On June 17, 2019 12:39 PM UTC

Hi Kundan, 
Thanks for contacting Syncfusion support. 
 
We have validated your issue. Before passing the json data into documenteditor open function, stringify the json data. Then it will open the content without any error.
  
 
Sample link:  

Sample code:
  
 
documenteditor.open(JSON.stringify({"sections":[{"sectionFormat":{"pageWidth":612,"pageHeight":792,"leftMargin":72,"rightMargin":72,"topMargin":72,"bottomMargin":72,"differentFirstPage":false,"differentOddAndEvenPages":false,"headerDistance":36,"footerDistance":36,"bidi":false},"blocks":[{"paragraphFormat":{"styleName":"Normal","listFormat":{}},"characterFormat":{},"inlines":[{"characterFormat":{"bidi":false},"text":"This is test report"}]},{"paragraphFormat":{"styleName":"Normal","listFormat":{}},"characterFormat":{},"inlines":[{"characterFormat":{"bidi":false},"text":"by"},{"characterFormat":{"bidi":false},"text":"\t"},{"characterFormat":{"bidi":false},"text":"gvgj"},{"characterFormat":{"bidi":false},"text":"kundan"}]}],"headersFooters":{}}],"characterFormat":{"bold":false,"italic":false,"fontSize":11,"fontFamily":"Calibri","underline":"None","strikethrough":"None","baselineAlignment":"Normal","highlightColor":"NoColor","fontColor":"#000000","fontSizeBidi":11,"fontFamilyBidi":"Calibri"},"paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":0,"afterSpacing":0,"lineSpacing":1,"lineSpacingType":"Multiple","listFormat":{},"bidi":false},"defaultTabWidth":36,"styles":[],"lists":[],"abstractLists":[]}));  
  
Regards, 
Ramya T 


Kundan
Replied On June 17, 2019 02:21 PM UTC

A big thanks.

Ramya Thirugnanam [Syncfusion]
Replied On June 18, 2019 05:23 AM UTC

Hi Kundan 
 
Thanks for your update. 
 
Regards,
Ramya T
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon