How to save "syncfusion document editor" to database - syncfusion

I want to save the document editor provided by syncfusion but i'm not able to implement the save functionality. could anyone help me

Using SaveASBlob() method you will get the Document as Blob stream(Docx format) in client side and you can save that stream in Database.
Below KB link contains how to save the document in APP_Data folder, you can customize it based on your requirement.
https://www.syncfusion.com/kb/10304/how-to-load-save-file-in-web-server-for-asp-net-core

Related

How to upload and retrieve pdf file in sqllite database

I want upload pdf file into sqlite and retrieve the pdf file into listview how can I do that please send me the code after I retrieve the pdf file in list view it as to open in pdf file how can I do that please help me out
Thank in advance
I personally suggest you to use the cloud firestore to your application which will be helpful to upload or access the contents of files.
you can save the files in the firebase storage and then use the links to access them and list into the listview

How to get/save data from database using draft-js

I decided to raise the issue here. I use mysql as the database as a storage and would like to add draft-js into the web page I am building now. What is the correct way of getting and saving data into the database? Any working examples would be great!
You should use convertToRaw and convertFromRaw methods. Extracts from documentation:
convertFromRaw(rawState: RawDraftContentState): ContentState
Given a raw state, convert it to a ContentState. This is useful when
restoring contents to use within a Draft editor.
convertToRaw(contentState: ContentState): RawDraftContentState
Given a ContentState object, convert it to a raw JS structure. This is
useful when saving an editor state for storage, conversion to other formats, or other usage within an application.
I forked this pen for demonstration how these methods work. Open my pen. First, let's consider a saving editor state. I added "Log editor state" button. If you open console and click on the button, you can see current representation of editor state as JavaScript object. You can convert this object to JSON and save this JSON in your database using the appropriate API endpoint.
click to image for full size
The case when you need to show your editor on the page not empty, with a predefined content which you had previously saved in database or, for example, localstorage. Here, you should use createWithContent method and mentioned above convertFromRaw method. In my example I stored JSON string in the variable editorStateAsJSONString, for a real-world case you should request API endpoint, which returned JSON, and, after it, render the editor component as described.

MS Word - Possible to Add Embedded Document?

I'm in the process of exploring the possibilities of Word VSTO add-in. Using a combination of custom task pane(s), a custom ribbon and a series of dialog boxes or forms I can collection information from the user. However, what I can figure out is where I can persist this information within the document. A docx is made of a series of individual files, how do I add my file within the cab as well? Storing the custom info outside of the document is not an option, it must travel with the document itself.
Thanks,
Update : If I use custom xml parts per the solution mentioned here https://msdn.microsoft.com/en-us/library/bb608612.aspx then it appears to me that the xml data is visible to the user. See screen shot. The user should not be able to browse data that my add-in is storeing - not because it's senstitive but because it makes no sense for them to see and interact with a bunch of serialized class data.
You can store your custom information inside the document using so called Custom XML Parts. This information is stored within the document.
Here is an example how to add a Custom XML Part to your document:
How to: Add Custom XML Parts to Documents by Using VSTO Add-Ins

Word Add-in - Save/load document to/from a specific location

I'm currently developing a Word add-in using the word-15.js script. I'm trying to save the document on some location. I assume that calling document.save(), saves the document to a location where the document already exists, so only if the document has been saved before and isn't a new document.
In my scenario, I'm trying to save/load a new document. For instance, when the user has created a new document and entered some text or other data, my add-in can load a SharePoint document library and save the that location. For instance: https://my-tenant.sharepoint.com/sites/my-site/_api/web/GetFolderByServerRelativeUrl('Shared Documents')/Files/add(url='test.docx', overwrite=true).
I haven't seen this done in any examples that I've been able to scramble through. Is this even possible? And if so, how?
there is no such API. you can, however, get the document (as docx, pdf or txt) using the getFileAsync API. and then once once you have the bits of the document you can upload it anywhere you need.
Here are more details and an example on how to use getFileAsync.
https://github.com/OfficeDev/office-js-docs/blob/master/reference/shared/document.getfileasync.md

Where to store a preview of a UIDocument?

I'm working on UIDocument application and I'd like to show the user a preview of the document before he opens it. I can render that preview into an image when the document get's closed. But where should I save that image? In an other file? or is there a designated way to do this?
Right now I'm developing it without iCloud support. But I want to have a solution that would work with iCloud too. The UIDocument is a UIManagedDocument. But saving the image into the database would make it kind a pointless. Because then I have to open the document before I can get the preview.
What do you recommend here? Where to put a preview for a UIManagedDocument?
You can store your documents in your ubiquity container's Documents directory and document preview files in the container's Data directory.
If preview file names will be based on the documents names you will be able to use metadata query result to get the document names and then resolve document preview urls.
This way you could download the document previews only but not the whole document.
I don't know about UIManagedDocuments, but in case of a UIDocument I would recommend using a NSFileWrapper as file format (where the document is actually a bundled folder) and save the preview within the document, as "Preview.jpg" (or .png) inside a folder labeled "QuickLook".
This way, you'll get the preview in Finder on the Mac as well (for free).
Of course this may or may not be an ideal solution (also depending on if your document is text-only). But it might be a good hint for working with previews for UIDocuments in general.
You should save an image under (app_directory)/Library/Caches. That way iCloud won't affect your app.