Load PDFs from local file share - adobe-embed-api

I'm developing a web app for in-house use and I'm looking for a better way to display PDFs.
I've played around with Adobe's 'Work with Local File' example from GitHub, Adobe GitHub Example, and it works great using the file picker to display a PDF. Is it possible with Adobe's PDF Embed API to take a file located on a local file share and display the PDF?
I'm thinking I need to create a file promise but I'm not sure how to create that.

Unless you can make a network request to load the PDF, the answer is no. Browsers generally can't read from local files unless a user action actually picks the file. If your local share can be made accessible via HTTP, then you would be good to go.

Related

Can't load an Adobe Captivate HTML5 presentation in a Google Cloud Storage bucket

I am trying to store an Adobe Captivate HTML5 file in a bucket and then load the file and play the presentation. I've watched other videos on this and many people have successfully used Google Cloud Storage for this purpose, but they generally use it on a public bucket. My bucket is private and only accessible to a couple of users if it matters.
The file I'm trying to load will only go as far as showing a loading icon. Originally it only showed a blank page, and I was advised to add a tag to the with the "Authenticated URL" of the file and now it shows a loading icon but still won't load correctly.
Has anyone had this issue with html5 files before? Or know if there is anything in particular you need to do differently to view a file like this on a private bucket with a couple users vs allUsers?
Adobe Captivate HTML5 file, is still HTML codes. After you uploaded to the GCS, when you visit GCS bucket, actually you executed getobject, you downloaded the file to your browser, of course, the browser can write HTML file and display in your browser. Just set it to public to allusers, clean the browser cache. the try to use the public url visit again.

Access downloaded pdf file path in HTML5 file system and display it in webview

In my chrome app, I am using HTML5 file system to save the pdf files to sand box.Downloading is working fine.But how do i access that downloaded file path? I want to give that path as webview source.
The best way, if it works, would be to use a filesystem URL. To get this use FileEntry.toURL
These don't work on external files (i.e. files that come from chrome.fileSystem.chooseEntry and are outside the app's sandbox) but should work for files in the app's sandbox.
Note, I am referring to filesystem:// urls not file://urls, which won't work as Marc Rochkind has pointed out in his answer.
Disclaimer: I haven't tested this, but I believe it should work.
You need to get the contents of the PDF into a data URL. See my answer to this question:
Download external pdf files to chrome packaged app's file system

How to add a unity app to a wix site?

I developed a simple app in Unity for a web site. How can I add my app to my wix site?
I tried finding on the web articles on how to do so but found nothing useful.
A web build will provide you with an HTML and a .unity3d file. If your host allows you to embed HTML, take the relevant sections out of the HTML file and upload your .unity3d file.
If your host does not allow you to upload the required .unity3d file, you'll have to host it yourself. This can be on your own server, on a Dropbox, or wherever you find appropriate. This does require a small change in the generated JavaScript.
Inside your HTML file you'll find a line like
u.initPlugin(jQuery("#unityPlayer")[0], "myAwesomeGame.unity3d");
Of course the exact name depends on however your build was named. If you don't host it in the same location as the HTML, you'll need to update this.
Say you're uploading it to your public Dropbox folder. In that case you can get a public link for the Unity3D file. Replace the call above with something like
u.initPlugin(jQuery("#unityPlayer")[0], "https://dl.dropboxusercontent.com/u/XXXXXXXX/myAwesomeGame.unity3d");
and you should be good to go. Of course the same works for other hosts.

How can I save a html file with external resources using AFNetworking?

I would like to save a .html webpage with AFNetworking, but would also like to save the resources (such as .css files, .js files, images etc) within the webpage so that the whole webpage can be viewed offline.
Is this possible with AFNetworking, and how would I do it? Could a short example be posted please?
Thanks!
AFNetworking is not necessary to do this. Instead, what you want to do is use an NSURLCache subclass that supports disk cacheing (such as Peter Steinberger's fork of SDURLCache). With that in place, just load up a URL using a UIWebView (this may not necessarily have to be displayed to a user), and subsequent loads should use that local cache.
At the very least, do not waste your time trying to write something on your own to download assets on a webpage. This process requires a web browser (which UIWebView qualifies as) to determine everything needed to load.

uploading image to server in iphone and show progress bar....?

i am making an app in which i have to upload an image/video file to the server...i want to know what things i needed to do this..?and i also have to show the progress bar while image is uploading...how can i do this..?
can you write some code snippet on how to upload file to server...?
If you are using http to transfer files.Allseeing-i have a great api for this called ASIHTTPRequest, its feature rich, well documented, easy to use and it supports file transfer tracking.
They have code examples and a description on how to include it in your projects.