I would like to display some files from google drives embedded on a website.
I'm downloading the pdf's so they use the adobe plugin.
<object data="https://docs.google.com/..." width="100%" height="100%"></object>
But I would like to display other files (word/excel,...) on the website too.
At the moment I'm using preview but I can't find a way to zoom in/out,download button,...
<iframe src="https://docs.google.com/file/d/googleId/preview" width="100%" height="100%"></iframe>
I could also use /edit in stead of /preview but this gives the entire drive ui in an Iframe.
Is there another way to display a drive file on a website?
My application has all the drive Id's stored of the files it has to display. All the users who use the application have read access to the file!
You can easily embed any document using Google Docs Viewer, like this:
<iframe src="http://docs.google.com/viewer?url=https%3A%2F%2Fdocs.google.com%2Fuc%3Fexport%3Ddownload%26id%3D0BzEbtMoF6IXbRGE1MUtHYTI1Rkk&embedded=true" width="450" height="350"></iframe>
where 0BzEbtMoF6IXbRGE1MUtHYTI1Rkk is the file ID.
The other way to display these files would be to export them as PDF. For this, you can use the exportLinks of a file resource.
Google provide an example of how to fetch these export link in the document about downloading files with the Drive SDK.
Related
I am a total newbie in webdesign and I have created a site using the Joomla CMS. However, on a particular page within the site I am trying to launch an interactive calculator that uses java via .class files which are called by an .html file. I used the embedding tag:
<embed src="images/Calculator/classes/examples/PayeCalc.html"
type="application/x-java-applet"
width="1108" height="407">
Nothing shows up on the page however, when I preview it. What am I doing wrong? The .class files are saved in the folder that the .html file is located. Isn't it supposed to call up the files as needed? Why is the page just blank? Can anyone help this newbie to resolve this issue?
Thanks in advance.
Check if your text editor removes the embed tag.
It can happen from the joomla text filters or from the text editor.
Try using JCE text editor and follow the steps described here
Also if you use RSFirewall check this out
Good luck
How to generate the PDF in CQ5.6.1 using page content.
A button in my site (genarate PDF) on click of the button i have to genarate the PDF file using the same page content.
Please let me know is there any out of the box PDF genarator in CQ or do i need to get the any linsenced product to genarate the PDF.
Thanks..
Adobe CQ is integrated with the Apache FOP, a formatter able to create PDF files. This tutorial describes how to enable content rewriter providing PDF version of the content under the .pdf extension.
However, please keep in mind that this approach requires manually writing the XSLT transform file able to process your page (and every component on it) and output the XSL-FO document.
In a previous project (CQ 5.5) we used https://code.google.com/p/wkhtmltopdf/ to create PDF files.. worked pretty good!
I had used Phantomjs to create a a custom pdf from the cq5 pages. for example if you don not want to display the right trail in the pdf or you want to disable the header footer. all this can be achieved with the help of phantomjs.
create a servlet which will execute a command at your server.
phantomjs <custom.js> 'page_url' nameofthepdf.pdf
here custom.js will show or hide html content based on your need.
This will work for all pages irrespective of cq5 or any tool.
I converting HTML file to PDF via Google Drive Service. I want to add Header and Footer on pages. How can do that using Java Google Drive API?
PS: If there is not proper way than any workaround would be appreciated.
I don't think you can do this directly using Google Drive API. If you are fine with some workaround, I would use Google Apps Script FooterSection Class:
Upload file using Files.insert() with option convert=true
Either trigger or keep running script on specific folder which does the following:
Modify Footer using FooterSection Class
Export Google Document file as PDF
In order to export PDF, there are two ways I can think of.
Using Document Class of Apps script
doc.getAs("application/pdf")
Or getting export link of PDF from Google Drive API using Files.list() where you can get downloadable link for PDF.
"exportLinks": {
"application/pdf": "https://docs.google.com/feeds/download/spreadsheets/Export?key={FILE_KEY}&exportFormat=pdf",
"application/x-vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/feeds/download/spreadsheets/Export?key={FILE_KEY}&exportFormat=ods",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "https://docs.google.com/feeds/download/spreadsheets/Export?key={FILE_KEY}&exportFormat=xlsx"
},
I'm working on an android app to fetch some files from the internet. The website contains a list different files which you can download. It also contains some subfolders with files. Is there a way to get a list of the filenames and links so a user can choose which ones to downloade from my app?
If the website displays the information via HTML, you can screen scrap the HTML with a library like JSoup [1] If they allow directory listings you can parse that too to show the user this information. It depends on the API exposed by the website to display the files.
[1] - http://jsoup.org/
How do I mass upload PDF files or a folder with PDF files and save it into my MySQL database using Servlet?
The best you do is to ask user to specify the files using several <input type="file"...> elements on the page. And on submit check if all the files are PDF or not, perform desired action in either case. Or you can check for the PDF extension right away using JavaScript. You can also validate using AJAX, just send an AJAX request to the server on a onBlur event of the input field.
Otherwise, a privileged applet might be able to help a little more than this. For example asking a directory and scanning for all PDF's etc.