box-api override embedded viewer to view html - html

Is there a way to share a complex HTML file with box? Currently when I share an HTML5 file it opens in the embedded viewer and it is not rendered correctly. It would be great if I could share a file that could be responsively rendered on all devices without the need for it to be on a hosting site.

For paid Box.com accounts only, you can use a direct link as outlined here:
https://support.box.com/hc/en-us/articles/200519908-Direct-Linking
Unfortunately, with a complex HTML file as you're describing, it may not render properly anyway depending on the browser/device, since the file is downloaded as an attachment and not viewed in the browser via box.com.

Related

How to preview local files in the browser in another html page

i am looking for a creative solution for a new task.
my issue is we need a way to preview local files (extentions: doc, docx, ppt, pptx, pdf, tif, jpeg) in a frame or so of a different web page which provides a link.
preview should look like an image of the files or so.
we would like to prevent parsing the files to pdf in order to save time...
we are using angular 7, c# asp.net server side.
we are very limitted in most solutions, as the data is very secure and is used in an inner office net,
that is why we can't use the google docs solution.
i also understood that using iframe tag and pointing it src attribute to the file source doesn't load the page due to security resones.
in addition all users has the ability to preview the above files types when they do it straight from the document by the open with -> IE or other browsers options.
i tried :
<iframe src="file:///C:/Users/cd/Downloads/MyFile.docx"></iframe>
but:
the iframe tag doesn't open the doc file, i can see the iframe in the DOM as a new html but it doesnt have a content of anything
i tried also for images and the same, the frame is blank
If you are using chrome then chrome specifically blocks local file access this way for security reasons.
more detail is this link : here
One possible solution is, render the document pages as images and then display them on the web page i.e. using the iframe.
You may use GroupDocs.Viewer for .NET for rendering the document pages into high-fidelity images (PNG/JPG). You can then embed the images into your web page to preview the document. This is how you can get the image representation of the pages in a Word document:
using GroupDocs.Viewer.Options;
// Set output path
string OutputPagePathFormat = Path.Combine("D:\\output", "page_{0}.png");
// Render document pages
using (Viewer viewer = new Viewer("D:\\sample.docx"))
{
PngViewOptions options = new PngViewOptions(OutputPagePathFormat);
viewer.View(options);
// Rendered images will be saved in the D:\output\ directory.
}
Disclosure: I work as a developer evangelist at GroupDocs.

PDF link and accessibility -- download yes or no?

I'm creating a site with downloadable PDF links in which we add a parameter at the end of the file download URL to tell the browser how to serve up the file:
https://example.com?ref=0&download=y
Using the parameter download=y opens the browser's file download dialog, asking the user to save the file to their desktop so they can open it with their machine's default PDF viewer.
Using download=n will open the browser's built-in PDF viewer, allowing the user to read the PDF without saving it to their machine.
I'm trying to understand which approach is more accessible for mobile / desktop / users with disabilities. Is one approach inherently better than the other from an accessibility perspective?
You could always let the user decide. If your link went directly to a PDF, then the user can change their browser settings to either view the PDF within the browser or to use an external viewer. I much prefer that over the web developer trying to choose for me (no offense). Personally, I like to view the PDF externally in Acrobat because the screen reader handles the PDF pretty well if the PDF is tagged. If you don't have a tagged PDF, then it won't matter how you serve up the file because the visually impaired user will have a tough time reading it.
Letting the user decide is the correct approach. This isn't a setting that you should be attempting to configure for accessibilty purposes.
Having properly tagged PDF documents is vastly more important.
It's also good practice that any HTML links to PDF documents be labeled as such in the anchor text.
e.g. Title of Document (PDF)

Extract Images from OneNote Page, Section, or File

Is there a way, either through native features or through code, that I can extract all the images from a OneNote page (for example created by OfficeLens or just embedding the image in the Page) and save them as JPGs (or another format)? Ideally I'd like to get them into SharePoint Online.
You can use the page recall APIs to get all the images from a page. They are in BETA right now.
http://blogs.msdn.com/b/onenotedev/archive/2014/09/18/new-beta-api-page-recall.aspx

View HTML file directly vs. downloading as attachment

We have paid Box.com accounts. Our users occasionally want to upload complex HTML files to these sites to share with customers, as they don't have access to an internet-facing web host.
The HTML files are self-contained in that they have no references to other files in the box account. That is, all scripts, css, and images are publicly-accessible.
Using the Direct Link method of Box, the users can send the URLs to the client. However, when the clients access the link, the HTML files are downloaded as attachments, vs. being viewed "inline" in the browser. This causes the files not to function like a normal HTML file on mobile devices, because the attachment triggers a different viewer other than the standard browser.
What we'd like to do is literally open that HTML file right in the browser using the direct link. Is there anyway to override the forcing of HTML files downloading as attachments?

How can I display local HTML in the windows phone web browser?

I want to use a web browser to present some multimedia information with locally stored HTML files. The problem is that it just presents the static content without any HTML elements, and also doesn't show the images. The sample code is:
StreamReader reader = new StreamReader(TitleContainer.OpenStream("pathString"));
webBrowser.NavigateToString(reader.ReadToEnd());
The best way to do this is to copy your html file and images to the same directory in Isolated Storage (see: http://msdn.microsoft.com/en-us/library/ff431811(v=vs.92).aspx). Then, you call
webBrowser1.Navigate(new Uri("<Location_of_html_file_in_isolatedStorage>", UriKind.Relative)).
If the images and the html file are in the same directory in isolatedStorage, relative links to your images in this format:
<img src="../YourImage.jpg"/>
Will work correctly.
I don't suppose the WebBrowser control could get access to any images that might be stored in isolated storage, so all the content you want displayed - you would probably need to somehow embed it in a single html, which would probably require some js code (I am not a js/html expert), which needs to be enabled in the control (IsScriptEnabled if I remember correctly). Otherwise - it might be better to convert your HTML to XAML or just otherwise parse it and display it by code.