Google Embedded PDF Zoom Parameter - html

I want to embed a PDF in chrome such that that the document fills the available horizontal space of the plugin. (i.e. Minimal gray plugin background at the sides of the document). Is there a way to pass a parameter when I embed the PDF that can specify the zoom level I want the document to open at?
Couldn't find anything recent on this topic. I found this but it's a couple years old and Google changed their PDF viewer recently.

Now it is possible.
You can provide plugin options via url.
To set document zoom to fit window width you need:
http://example.com/sample.pdf#view=fith
where fith - stands for fit horizontally

Related

How to insert a pdf file as an image in HTML?

<img src="img.pdf"> doesn't work due to it being a pdf. I don't like the embed and iframe environments either, since they add the pdf viewer options, the scroll etc. I tried converting the pdf to an image with the convert and pdftoppm commands on Linux, but these result in the image having extra white space on top and bottom to fit A4 format, and/or makes the background black (instead of white or transparent).
Any ideas?
"Img" is in effect an iFrame of an embedded binary object, but it is borderless since it is statically scaled to one non zoomable size. Note the img above this text is framed as https://i.stack.imgur.com/xpw2l.png
Yes there are ways to make it more dynamic but vanilla binary PNG/JPG/ETC are imbedded, and part of the binary HTML viewer renders those fixed areas. You can switch them off if you wish, or they don't display if badly served.
So why is PDF not simply treated like an image as per your question?
The answer is simple they are a different type of binary that requires a different html viewing binary extension. One frequent complaint is why use "menus and scrollbars if not needed for a simple file?"
The answer to that is those controls need to be in the extension, for zoom pan etc. So how comes the FireFox viewer above has none?, that's because as a user I switched them OFF.

HTML - Image over another image which triggers a popup window

I had a quick search for this problem and couldn't find anything that satisfied both parts so I hope this is ok to ask:
I am creating an interactive map which has an aerial image of a location as a background, with small icons overlayed over the top. These icons, when clicked should open a popup window with images or videos that have been taken in those locations, much like a google map.
I have found code to allow me to layer images over each other here:
Html Image over image
And I have found code for a popup here:
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_popup
And I can get both of these elements to work separately on my webpage, however I'm stuck as to how to combine them so that the image I have overlayed can be clicked on to trigger a popup.
It's been a while since I have coded in HTML and I can usually handle these kind of challenges but I'm finding myself a bit out of my element here.
Thanks!

Inserting an iframe or Dynamic content into an info window?

I have a google map which is hooked up to a fusion table. Its pretty basic, lists street address, phone, and branch #.
I recently got a request though to add current weather to the info window that appears when a user clicks on a map marker.
Initially I thought I could just iframe this in, but it appears that google strips that HTML out of the info window when I add it in. I guess only basic html is allowed.
Does anyone know a way to throw dynamic content into that info window box or a way to get around google stripping out the iframe code?
The only iFrames I can get to work in fusion table map windows or cards are youtube embeds. Other iframes appear to get srtipped out as you say. It would be a good feature to be able to have universal iframe content instead of just google products.

Google Chrome Extension Top Sites Images

So using the Google Chrome Top Sites api has values for the url and the title, but when you load the default google chrome page it also has an image of those sites, is there any way to get that sort of image for an extension? If not how does google get that image and how can you get an image of the the user's top viewed website?
Since that it isn't possible to get a screenshot of a page without loading it inside a tab, Chrome is simply getting those screenshots while you're browsing your favourite sites. You can tell this easily because sometimes sites and images do not coincide (e.g. sometimes my facebook.com top site has the image of my profile page, but links to the home).
Then, if you want your screenshots of the Top Sites, you'll have to start without screenshots, and create them while the user browses the web by using the chrome.tabs API to check when a tab loads one of the Top Sites (listening to the event onUpdated), and get a screenshot of that tab using captureVisibleTab.
NOTES: make sure that you've requested the permission for "<all_urls>" in your manifest, which is required for captureVisibleTab to work. Additionally, you may find this question and its answer helpful.
It's unfortunately not possible*. Chrome stores those thumbnails internally in URIs not accessible from an extension.
There is an existing feature request: https://code.google.com/p/chromium/issues/detail?id=11854
If you look at the comments, one of the main use cases is to access site thumbnails to replicate the New Tab page.
Do star the feature request above to raise its priority if you want this functionality implemented.
* By that I mean that it's not possilbe to access Chrome's own internal store of thumbnails.
Furthermore, as Marco suggested the way to replicate that would be tab capture, but you can't do it "in the background" for privacy reasons - a user must make an explicit gesture (e.g. click the extension's button, press a shortcut, etc.) to perform capture.
Marco's answer is valid now, captureVisibleTab should be accessible upon events. But yes, as of now Chrome forces you to have very broad permissions and maintaining your own thumbnail store.

HTML to make a PDF display at a certain size when clicked

I have an uploaded PDF which, when clicked in the browser, is displayed using Adobe or whatever plugin the user has. But it's a pretty large file, so I'm wondering if there is a way to have it open, say, a specific size or percentage of original. Is this possible?
Yes, it is possible to open it at a specific percentage or in fit view mode. You set the document's Open action with a Goto action that targets the page you want to display. When you set the target page you also have the option to set the desired zoom or a Fit mode.