JavaScript API to work with Excel files stored on OneDrive? - javascript

I want to create an web application that uses an Excel file stored on the users OneDrive, preferably directly from JavaScript. The web application should not be running inside Excel on the client, so I think that excludes the JavaScript API for Office.
Are there any alternative APIs or is it simply not possible?

You can use the OneDrive Javascript SDK to get Excel files (download) from a user's OneDrive, and then manipulate that content once retrieved from the service.
You can use the OneDrive Javascript SDK directly to traverse the file hierarchy and find an Excel file, or you can use the Web picker to let a user choose (or save) the file (free UI, no need to build hierarchy traversal).
In terms of actually manipulating the Excel file, there are certainly modules and libraries available to help do this (node.js, python)

Related

How to change xml value in local project file with javascript

I have a web project that I made with HTML-Javascript. I want to use the XML file (in local project folders) in this web project in javascript. Then I want to make a few changes in this XML file and overwrite the same xml file again. How can I do that?
JavaScript runs in the browser and is isolated from the local system. So the usual way is to upload/download the file. However here are several possibilities.
A small server application
Develop and start a small server application for example with node.js. The server part will provide the file system access.
Use a wrapper
A more advanced version of the previous solution, you encapsulate the web application using a wrapper like Electron.
File System Access API
Use the File System Access API available in some of the new Chromium based browsers.

How can we create PDF in Nodejs

I have to create PDF from html in java-script, Node,Already I have use phantomjs but I need to use another one .
PSPDFKit for Web is a JavaScript library for generating PDF documents in a web app without using a server. Newly created PDFs can be rendered in our client-side viewer for signing, editing, form fill, and more.
PSPDFKit SDKs are deployed in some of the world’s most popular applications, such as those made by Autodesk, Disney, DocuSign, Dropbox, IBM, and Lufthansa.

How can you access data in an Excel Spreadsheet using javascript

I have a website that uses some JavaScript to access data in a .xlsx file from a Microsoft Excel Spreadsheet. When testing I was able to access it by having the file in the same folder, however in practice my company uses SquareSpace, and the way to access their files is more complicated than I would like, since I need to set it up so that the less tech savvy people in the company can reupload and update the spreadsheet. Preferably, I'd like to have it so that my script is accessing the file directly from OneDrive. I know it's possible to display a spreadsheet on from OneDrive on SquareSpace (or any website) by embedding it. But I don't need to display the spreadsheet, I need my code to read the data in the spreadsheet and respond to it. Essentially, is there a way to connect a website to a Microsoft Excel document and save the data as JavaScript variables?

How to convert DOCX to ODT format using javascript?

I am working on a in-website document editor(word and excel document). So far I am able to edit ODT files using WEBODF. Is there any way to convert DOCX file to ODT using javascript so that i can use the file in the editor? any alternatives for editing word and excel documents inside a website? I have tried saving the file in OneDrive and then using the share link to open editing on sharepoint but this editor cannot be inserted inside an website and can only be done in a new tab? i need the editor inside the website as i need to implement azure versioning of the documents
WebODF is an awesome tool to be used as an online editor. Assuming you have no restrictions implementing a separate backend server, you can use libreoffice, which gives you a command line utility to exactly perform that job. You can convert docx file to odt file using the following command -
soffice --headless --convert-to odt <input file>.docx
The approach would be to create an API
Which would take docx file as input
Store that file temporarily somewhere and run the above command
Serve the converted odt file and delete the temporary files.
If you want to store those files in the server, then you can maintain a database to achieve that as well.
To take care of restricted cross origin policy, you can implement AJAX calls in the front-end to perform file uploading and viewing operations using Javascript blobs.

How to generate an excel file with file attachments in the cells programmatically using Node.js or browser javascript?

I know how to generate a simple excel file using Node.js or browser javascript. However I can't find any documentations on generating an excel file where some of the cells are file attachments (not just urls). Note: The attachments data will be obtained via a 3rd party api as suppose to local files. But I don't think that should matter. Thanks!

Categories

Resources