OneDrive shared link branding or changing layout - javascript

I am currently developing a RESTful based service where I call the OneDrive API to store and retrieve Word documents. I can also generate a so called "shared edit link (shared_edit_link)" or a "shared read link" (shared_read_link) which points to uploaded Word documents and this allows me to give the shared link to anyone so they can edit the Word document. Works great.
When you open the shared edit link you see the OneDrive online Word editor with the document with in the header buttons for signing in and sharing the document to OneDrive.
Question: is it possible to change the layout of the OneDrive Word editor with a custom logo/branding and/or is it possible to remove the buttons for signing in and sharing the document? I would like to only show the document with the Word functionality, preferably nothing related to signing in or sharing to OneDrive.

Short answer, no.
Long answer, what you want sounds like your own online document editor. So, it is certainly possible to get the document content via API and then insert that into your own custom editor that you built. But there is no way to programmatically alter the provided OneDrive/Office Online/Word editor to remove branding, etc.

Related

How to edit pdf stored in a server by a webapp client?

The use case of this problem is very simple but i struggle to find a good solution for it.
I want to allow my users (through a webapp) fill some pdf files stored in server (pdf with forms, which begin more and more popular).
Actually, app like chrome or acrobat reader are able to fill them perfectly whe its open locally.
I already allow this functionnality for docx and xlsx files, for that i use Webdav and the custom protocols ms-word ad ms-excel. It works perfectly.
For pdf, I didnt found equivalent. Its look the mains pdf reader/editor doesn't implement this protocol. Whe we open distant file with these tools, they failed for write permission when save or they try to save the file locally) .
Another option i take a look was the new file system access api (https://web.dev/file-system-access/). But again i wasn't able to make it working properly. The main problem here is how we can edit the file.? Im able with this api to dowload the file locally and keep the filehandler to retrieve the updates, but i blocked on how i can edit the file ? like an option on the fileHandler to say "Open this file with default editor on the OS". this would be perfect. But for now to edit the file i have to manually open it on the eplorer. i can't ask my end user to do that there is too many risk they edit the wrong file.
Another option on the table is the different javascript library for editing PDF, but these last one looks all very expensive, usually very heavy on the client side, with advanced features definitively i don't need. I just want to fill the forms and retrieve the pdf completed. So i would like to avoid this option.
Last option i take a look, i already use pdf.js (from mozilla) and pdf-lib.js in my app for some drawing features. I was thinking
rendering the pdf with pdf.js
retrieve all the forms fields (id, type, size, position) of the pdf with pdf-lib
generate html input write on the top of the pdf with the informations given by pdf-lib
i let the users fill the input and click on a save button whe he finished
on the save, i edit my pdf with pdf lib, i set the value of all my forms fields by taking value of the corresponding html input, and i retrieved the pdf updated.
This solution look for me the more "feasible". But im afraid of the volume of development, on how it will render, deal with zoom, rotation, etc. i would like to not have my custom solution.
I precise my webapp target chrome so it make me crazy to not be able to use the chrome pdf viewer/editor to do what i want.
PS : i struggle to post this question on stackoverflow. the previous one was deleted witout i had precise reasons. i try to be more specific on this one, but please if its such a dumb question, please answer it
I feel your pain, this is currently not possible. Adobe acrobat can open PDFs from webdav locations (simply call acrobat.exe and pass in the WebDAV UNC and it will work) but there is no way to trigger this from the browser.
If you are able to deploy software to your customers machines, you could create a custom URL scheme to do this...

json-ld for Javascript popup window content

on our website, products details page open via a Javascript popup window.
that same product page may be opened with a direct link to that page with the popup window opened.
In the above scenario #2 my json-ld data is loaded fine and Google structured data testing tool picks up the information.
However in the most common scenario i.e. scenario #1 above the json-ld data doesn't seem to load and the product information is null.
Example - scenerio 1: http://www.beride.net/school/guincho-adventours
Example - scenerio 2: http://www.beride.net/school/guincho-adventours?course=62
I used Google Tag manager to fire up the json-ld scripts
Does anyone know I can can get the json-ld information to load in the above scenario #1?
The Structured Data Testing Tool is not 100% at coping with JavaScript including the Google Tag Manager. Either post in rendered html to the tool or look at the Structured Data report in the Google Search Consoles.
Your first example is a list of products. Googles guides indicate that you should not mark up complete entities when they are listed as summaries that link to the details. They suggest you mark up a list of links.
https://developers.google.com/search/docs/guides/mark-up-listings

Embedding excel in a webpage

I have read from Microsoft here that I can embed an excel sheet in a webpage. I have also read where I can embed a visio instance. Does anyone know if I can create a website that uses an excel instance and visio instance that is unique to each user's experience and draws from their custom database.
For example: say I have a pre-formatted excel sheet with fixed columns and I ask for the user to import their report card, and they do so. The database stores their report card information and outputs it to the excel spreadsheet instance.
Is this a possibility or can I only embed one single excel workbook that will be linked to the master and can not be customized for each user's experience of my webpage/web app?
It would be really cool if I could do the same with Visio as well. I have tried to find an exact answer to this, but I can not get a clearly defined differentiation of whether or not I can get unique instances, or whether all must be viewing the same master document.
You may need some non-free office server product to be able to do that (edit excel docs online). That can be SharePoint, OneDrive for Business (which is basically just another name for SharePoint), or Office Online server (the underlying technology).
Given that you have that in place, the rest is pretty easy - you can create a document per user, and just display it in IFRAME (you can google "WopiFrame" on how to do that exactly).
On the server, in principle, you can bind your Excel sheets to Visio drawings. So that when you edit the sheet, corresponding Visio drawing view is updated. Keep in mind, that is probably possible within a single SharePoint site.
Means, from M$ side, probably the assumed approach could be, you embed Excel and Visio frames in a web page, then embed that page into a SharePoint site, then host that on SharePoint online, and then pay for that on regular basis :)
If you don't want SharePoint, you can still go with Office Online to enable Excel editing in IFRAME on your own site; but here you'll loose Visio rendering, as it's only available in SP. And you'll need to build you own API. AFAIK, viewing office docs is free, editing is not (requires end-user office licensing). In case you would like to go this path, you could start over here: https://wopi.readthedocs.io/

display external text from txt, html etc. (hosted on cloud) on web page

I manage a small web page for a relative's business. They want to provide notes on the page for the visitors regularly (opening times, news etc.) but cannot code the web page themselves.
Is there a way to embed a news scroller, text field, whatever on the page - however, the text displayed there then comes from an external source they can manage like a htm, txt, json (whatever) file hosted e.g. on their Google Drive that they simply need to change and see the edits directly in the web page (the file would be public; the URL to be embedded in the web page code).
Is there a solution or an easier way to achieve it? thx
You can use file_get_contents() if I got you right.
To achieve this, first you need to create a portion on the website to display the news or whatever external dynamic content you want.
Then you need to develop complete APIs for that site and then hit them from your website (Keep a secret key for safety). Your API can do everything you program it to do. (E.g You can put the news in database or create publicly accessible files through it)
When this is achieved, you can then fetch the data into the portion created for news etc. (automated through programming)
Using PHP you can achieve all the above mentioned steps.
That way you will just have to push/send the data from your APIs and the actual site will keep getting updated without any further action required.
Hope that helps.
If they can write the HTML and make it available at a public URL, you can simply embed it using <iframe> in HTML.

Export my SharePoint aspx page to a PDF file

I am working on an enterprise wiki site collection , and using the SharePoint designer I have manually added a link named “Print to PDF” as follow:-
But I am trying to implement the link functionalities, so when the user clink on the link, the page content (mainly any html components that are inside the rich text ) should be displayed inside a pdf file?
Can anyone advice how I can achieve this ,, can I write a javaScript code which can do the work ? Thanks
You can develop an ASPX page (actually preferably an ASHX handler) that does the work for you by accepting an URL to convert, which you then pass into a third party HTML to PDF library. The generated PDF file can then be returned to the user's browser.
Alternatively, have a look at this blog post (that I wrote, so big fat disclaimer about me being biased) that shows how you can buy a product off the shelf that does all the work for you.
You can read more about it here.
BTW, for questions related to SharePoint you may want to consider using sharepoint.stackexchange.com.

Categories