I am making a application which gets its data from Alfresco and i want to show a document (which is in Alfresco) on my page with controls like going to the previous and next page.
I found the jQuery Media library, but it only opens PDF files. So my question is, what is the best way of showing .doc, .docx, .ppt, .pptx, etc. files without going to Alfresco itself?
I've tried Prism Viewer and the Google Docs viewer but they both cant open files from Alfresco for some reason.
Thanks!
You should take a look at pdf.js - pdf.js is a browser-side PDF viewer.
If you're using the current HEAD of Alfresco community, then Alfresco transforms your content automatically to PDF and stores the PDF as rendition (as new new Alfresco Share Viewer uses pdf.js internally).
There is a community addon for Alfresco Share 4.2 that uses pdf.js as document viewer & also contains the pdf rendition configs. That should be a good starting point:
https://github.com/share-extras/media-viewers
Or checkout the current HEAD: https://github.com/Alfresco/community-edition
Here is the current thumbnail-service-context.xml where the pdf rendition is defined:
https://github.com/Alfresco/community-edition/blob/master/projects/repository/config/alfresco/thumbnail-service-context.xml#L219
Related
There is a webpage which uses iframes. The iframes can be used to embed videos(youtube/vimeo), websites(any), documents(.txt and .pdf) , and worksheets from Tableau. The no. of iframes and the content they load is dynamic within the context mentioned in the previous point. Along with the iframes, the webpage has some regular text content and images. How can we download this webpage ensuring we retain its layout and iframe content? (The download feature has to be a part of the webpage we are trying to download which is a part of an application developed in AngularJS.). I have tried using jsPDF and other PDF utilities(https://github.com/hearsid/ng-html-to-pdf-save) but they fail to render the iframe content.
Anyone who has come across a similar problem, please help.
Like
There is one solution is to use wkhtmltopadf, you should install the package in your machine and after that you can use it.
it's a very robust librray that runder vectoriel pdf instaed of other library that runder Bitmap.
Offical web site
Is it possible to use PDF.js without having the website online? I'm trying to do a simple offline website that reads pdf using pdf.js but it won't work without being online.
Anyone could help?
Yes absolutely you can use it offline. Download the latest version here.
Now extract the zip file and put it on a server(use xampp/wamp/lamp or any other localhost) because the worker is not enabled for file:// urls.
To show the pdf files traverse to web/viewer.html from the localhost and it should load its default pdf.
As to the question about how to show your pdf's use: viewer.html?file=relative/path/to/your/pdf
Say for example inside the web folder(the one in which viewer.html is there) of your pdf.js you create a directory say named pdfFiles and in it you add a pdf named say mypdf.pdf in it then to display it use: viewer.html?file=pdfFiles/mypdf.pdf and it will display it.
Look here for more details on how to dynamically assign PDF file paths to the viewer. If you have any other queries let me know. I have used pdf.js offline and it works wonderfully on almost all the browsers I know.
In my project, I want to somehow display a pdf file on the page. For this, I am trying to use the <object> tag. So far, so good, since the pdf lives in the /public folder in my Rails app.
The problem is that now I want the user to be able to display a pdf that is on his pc. I tried using Javascript to alter the <object> tag, but that does not work since Rails generates a new GET request to get the file, and the file is not on the server. Any ideas of how I can solve this?
I have tried using PDF.js, but it does not integrate well in the assets pipeline. Also, I would have to customize and hack the code to add some other functionalities, so PDF.js is kinda off the table (at least for now).
You can use the wicked_pdf gem to generate pdf then use Google PDF viewer for displaying it
I want to integrate some kind of web based PDF viewer so that user can not download the PDF files but they can View them. This is for securing the PDF files from downloads. Something like scribd.com
See example here : ref link
I used FlexPaper: flexpaper.devaldi.com
This compile PDF in SWF, so is more protected.
I think you need something like pdftohtml.
It is a tool based on the Xpdf package which translates PDF documents into HTML format.
You could use Flexpaper, too, but it's free of charge only for open source projects...
I'm trying to migrate various Excel applications to Google Apps. These generate html and javaScript based on various excel data and parameters to create a local html file which is then opened by a browser.
I know it's a long shot, but can anyone think of a way to mimic this behavior in Google Apps Script? Namely - create a file on the client and fetch it up in a browser session.
Here's an example of the type of application I mean
You can use DocsListApp.createFile to create new HTML files on the user's Google Drive, but I don't believe you can serve the HTML from Drive directly. Alternatively you can use the SitesApp to create a new page on a Google Site with the HTML you want, using Site.addWebPage. Finally, you may want to look into the widgets available in UiApp or the UI Builder, to see if you can use those instead of custom HTML.
Just saw this:
https://googledrive.com/host/0B716ywBKT84AMXBENXlnYmJISlE/GoogleDriveHosting.html
HTML files uploaded to Public Google Drive folder are served as HTML, link is available through "Preview" button.
So far it doesn't work with Google Drive files simply moved to that folder but perhaps would work with files created there via createFile script.