Printing images/pages from web browser control - html

I have a form that pulls a static map from google maps in the web browser control (access 2010). The format of the image is .png. I need for this map image to print when I print the forms.
Can I somehow save the image (embed) with the record? Link an image control to url? Use XML to grab the file from the web and store in the database?
I'd rather not have to download/link to the images each time. I'm running out of ideas and the web is coming up empty.
Here is an example URL
http://maps.google.com/maps/api/staticmap?center=37.386052,-122.083851&zoom=13&markers=37.386052,-122.083851&size=500x300&sensor=false
and this is the image link/xml
<img style="-webkit-user-select: none" src="http://maps.google.com/maps/api/staticmap?center=37.386052,-122.083851&zoom=13&markers=37.386052,-122.083851&size=500x300&sensor=false">
Thanks for any advice/tips!

You could try downloading the image separately from the web browser control. As access can't do this natively, have a look at this...

Related

src in html not allowed to load a local resource

I am doing a project, where I need to show an image on html page. The image is located in a network drive. Using the below tag to refer to the image, I receive a "Not allowed to load local resource:" error.
<img src="file://sc19/dept0213/SSC_Data/SVD/SVD%20Robot%20Experiment/4b9262caa1b64079ad8b31c3a3662598_1/Measurement/bot_Images/4.png" alt="Image">
If I however, open a new tab in the same Edge web browser, and copy the file://sc19/dept0213/SSC_Data/SVD/SVD%20Robot%20Experiment/4b9262caa1b64079ad8b31c3a3662598_1/Measurement/bot_Images/4.png into the address bar, the image is displayed inside the web browser. I have tried with Google Chrome in stead of Microsoft Edge and turned off the security feature, but still get the same error.
Additional information.
The HTML page was rendered using Django as backend. In my Django template I have.
<img src="file://sc19/dept0213/SSC_Data/SVD/SVD%20Robot%20Experiment/4b9262caa1b64079ad8b31c3a3662598_1/Measurement/bot_Images/4.png" alt="Image">
Could an alternative approach be that the front end is doing a request to the backend that then fetches the image, and put it somewhere that can be reached from front end?
For my project, the solution I ended up using was for my frontend to send a request to the backend. The backend then fetches the image, and send it as a blob to the frontend. I know that setting up a webserver is another possibility, but in this case my Django backend already acts as a webserver.

I need to take a PDF from a weblink (it is a shipping label) and display it on an HTML page and be able to print it out

I am integrating a shipping company's API with our business software. Their API returns a web address with the PDF file, which is a shipping label that we just purchased through the API. So something like... https://example.com/file.pdf
I need to embed, or place, or something the pdf file on a webpage.
The PDF is just one page and only a 4x6" label.
I have used iFrame and it displayed, although ugly.
I tried embed and object also and they also both worked.
The problem with all of these is that although I can see the label on the page, I cannot print it. When I go to print preview, I never see the label and it never prints.
I want to be able to place the image of the shipping label on the page and place several other elements too such as a receipt, message, etc. Then we will peel off the label and put the rest of the paper with the package.
I would prefer to do this without having to download the file anywhere and do any type of conversion because I know that will make things very difficult as I am basically a beginner. But I will if that is my only options.
SURELY there's an easy way to give the URL and then it give you a different URL of that PDF that's been converted to an image.
Or maybe I am asking too much...
Any help would be greatly appreciated!
I am using PHP, JS, JQuery, HTML, CSS
Reposting from this answer: https://stackoverflow.com/a/4854037/1027624
I use Google Docs embeddable PDF viewer. The docs don't have to be uploaded to Google Docs, but they do have to be available online.
<iframe src="http://docs.google.com/gview?url=http://path.com/to/your/pdf.pdf&embedded=true"
style="width:600px; height:500px;" frameborder="0"></iframe>
In this way you can directly use the API's returning web address.

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.

Google Drive images in img src=webContentLink?

Can I use images stored in Google Drive to be used in a website by the html,<img src="<webContentLink>" /> ?
Where <webContentLink> is returned after a file is uploaded and is in the format, 'https://drive.google.com/uc?id=<FILEID>&export=download'
I have a small website created for account users only. They can upload files to their google drive folder and this folder has permissions set to share with the accounts of the other users (specific people only). This is an ASP.NET MVC 5 website using the Google API Client Libraries for .NET.
In Chrome and Firefox the images display fine, in IE and Safari they don't show and return a 302 status code. Sometimes if you view the image directly in a new tab and then refresh the web page it shows. It might also show if the folder permission is set to 'anyone with the link', but this isn't ideal.
The documentation (https://developers.google.com/drive/v3/web/manage-downloads) says, 'If you want to allow a user to view a file directly in a web browser instead of through the API, use the webContentLink.' I understood this to be okay to use img src='' to display an image directly without the API, however it then goes on to say, 'You can either redirect a user to this URL, or offer it as a clickable link'.
So can Google please confirm if 'webContentLink' can be used in img src='', or not and why it works in some browsers and not others? I've read many posts on this, some old, some more recent. If it's not to be used in img src I think it should be made clear in the documentation.
Many thanks
Yes, you can definitely use webContentLink as your img src in your HTML page. I tried and this is what I got on my sample HTML page.
<img src = "https://drive.google.com/uc?id=0Bzgk4zncCwI7aDZCSHY4YU0zNUF&export=download">
webContentLink can be obtained using Files.list and place 'files' in the fields parameter.
Displaying an image from Google Drive can be done in 3 steps:
Retrieving your image ID
Right click on your image and select Share.
You'll see a link that you need to copy. You will extract the image's ID from the URL.
Here is what your sharing link should look like:
https://drive.google.com/open?id=YourFileId
Check your sharing settings
Your images will only be visible to people who have access to those files. To allow anyone access to your images, you need to set the sharing setting as Visible with the link.
Display your image
With your sharing settings properly configured and your image file IDs at hand, you can now specify how your images will be displayed using a prescribed format.
https://drive.google.com/thumbnail?id=YourFileID
More details can be found here
when I do this I just get a sign like an nonexistent image.
Why?
I just copy paste this line:
<img src = "https://drive.google.com/uc?id=0Bzgk4zncCwI7aDZCSHY4YU0zNUF&export=download">
JS Fiddle

Link to and display an image on an Access 2013 App view

I am using Access 2013 with our enterprise Office 365 Sharepoint site to create a simple Access App. I'm unsure of all the terminology--the main point is that this is an Access App as opposed to a desktop application. I am wondering if there is a way to display an image on a list view, where the image source is a data field. Here's what I can do so far and where I get stuck:
I can add a picture control. I can set the picture to a permanent URL that displays just fine in the view. However, this is a permanent setting for the view of any record.
I can add a URL field to the table. It's easy to pick the URL in datasheet view, and on list view, it's difficult to change the URL, but clicking on it will pop up the image (or whatever link) in a new tab or window.
I can create a Web Browser Control. I can have this control source be the URL frame. When I look at this view using an IE browser, I get something that looks like an iFrame. However, no matter what URL I try, the content will not load.
More clarification here: Depending on whether I try Flickr or an image hosted on my own OneDrive, I get different errors. One of the errors I get (tyring to use my own OneDrive with publicly shared image) is: "To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame."
More information: If I link to a publicly shared image from Google Drive, then the Web Browser Control does in fact show the image. This is not ideal, and I'd rather be able to dynamically change the link for the Picture Control, as opposed to embedding web content.
This is where I am stuck on two avenues. (A) The Web Browser Control will not show any content (maybe this is a security setting of my institution's Sharepoint 2013?). And (B) I cannot figure out how to dynamically change the URL for the picture control. Option B may be possible with a macro, but macros in Access Apps are different than desktop version and much more limited in capability. And I'm not good at either set of macros. Thanks for any ideas!