How to get Bookmarks toolbar information in JavaScript code? - toolbar

Is there any option for getting Bookmarks toolabr information from javascript code, i.e.
Can we get information what are bookmarkleted in the Bookmarks toolbar [url, text etc.]?

It depends on the toolbar you are talking about (a browser bookmarks bar? which browser?) and the environment the JavaScript executes in.
Assuming the latter is "a webpage loaded in a browser", then the answer is 'no, that would be a horrific invasion of privacy and security risk'.
Other environments (e.g. a browser plugin) have different restrictions and may allow access.

I think you can't. This would be privacy violation.
Ex: your js read bookmarks information and send by ajax to your server.

Related

Is it possible to customise the Docusign Iframe and avoid signers to have to enter their information?

Recently I have been looking into some different API for signing documents online, what I am looking for is one that has a customisable Iframe to avoid breaking the already established style of our website.
I would have wanted to know if Docusign proposes this kind of service.
For example, if we would just have the pdf file and a spot to sign, that would be perfect.
I hope I was clear enough with my question, thanks for your possible answers.
EDIT: I would have also liked to know if there is a way for the signer to not have to enter his personal information/sign in. One where that information is entered by us when the procedure is created.
Is it also possible to change the size of the zone where the signer signs, I was some other signing API's proposed it, but haven't seen it on Docusign.
How can I also change the language of the Iframe and disable the automatic mobile version.
Thanks for spending the time reading and helping me with these questions.
You can use an iframe for the signing when you use "embedded signing" in your integration. This is a common scenario and the signer won't have to log-in.
Even when using an email, most people just click on a link and they don't need to log in to DocuSign in order to sign.
The Docusign Iframe isn't 100% customisable, but you can remove some little extra UI with &noDownloadPrint=true&appname=docusignit, or add &disable_cc_for_selfsign=true to remove the "Sign and Return". From the creation of the Docusign EnvelopeAPI, you can't change the language of the Iframe.

Is there a way to get bookmarks information WITHOUT using JS?

I've been doing some research on this and I'm still not sure if it's possible.
Is there any way to retrieve a user's bookmarks and display them on the page without violating their privacy? I saw these two threads talking about using JS to do this:
How to get Bookmarks toolbar information in JavaScript code?
Show all bookmarks using javascript
I'm not thinking about doing this automatically, users would have to opt-in with a button that said "Display Bookmarks from My Browser" or something similar.
Is it possible?
Not without browser extensions. You could write a browser extension for the major browsers which retrieves the information and feeds it back to your page.

is it possible to have a link/button that directly prints a document via website?

is it possible to have a link/button that directly prints a document via website?
The closest you can do using normal techniques is use javascript to show the print dialog.
This limitation is built into the system, and is designed to protect users like you from spammers who dream of turning your printer into another fax machine spam target. To get around it you have to dip into the world of third party plugins.
Assuming you do not need to present a printer-friendly version of the page and just want to trigger the 'Print' function of the browser, just to this:
<input type="button" value="Print" onclick="window.print();" />
or using webcontrol button
<asp:button id="button1" runat="server" onclientclick="window.print(); return false;" text=Print" />
You may need to write Applet, Flash, ActiveX Components for this.
Please note also that:
ActiveX Component only works on Windows(mostly IE).
Applet/Flash may work on major OS such as Windows/MAC/Linux
I suggests you go with Applet though the client should need JRE installed.
Yes, simply call the javascript "window.print()" on the link or button.
i.e.
Edit: Saw your other comment about wanting to print Office documents. Your only options here are to either open the document using the native app, or convert to HTML or PDF server side.
As another posted pointed out, you could potentially embed an ActiveX object, but this causes all sorts of security issues and would be unlikely to work in the default IE security settings, and not at all on other web browsers.
If you are working in an Intranet, you could potentially have the server connect to the office printer directly, but other than this I'm afraid there's no real way to do it without significant caveats. I recommend just provide the user with a download, and let them print it themselves.
I think you may need to read complete document which is to be print with the help of some sort of library which reads whole document as text/html into memory stream and write to output stream, finally call the window.print();

ASP.net: Display PDF in a asp.net web page

User click on a link button and it will direct them to a url that is dynmaically generated which a pdf file. The browser will prompt the user to either save or open it.
I want to know if it is possible to downlaod the pdf file to the server then show the pdf file in the asp.net web page. When i google on this question, 99% of top link are some third party component. Is it a way to do this without purchase any 3rd party component?
thank
I use itextsharp, its a free open source c# port of the java itext library.
Makes generating dynamic pdfs in asp.net a breeze and there is lots of documentation/examples floating around.
I don't think that you'll have much luck without a 3rd party component. First, the issue isn't showing the PDF, it is generating it. For that, you'll need a library to help. Rolling one yourself would not be cheaper unless you have an enormous amount of unpaid time on your hands.
With respect to third-party controls, I recommend and use DynamicPDF from CeTe.
Yes there is a way to do this without a 3rd party tool, but it involves coding a PDF-to-html translator.
If this is something for a business, the RoI for the 3rd party control is that you don't have to spend hundreds of hours coding & testing this component, when you could buy one for just a few hundred dollars.
Now, an alternative is to code a page which displays the data in the same way which the PDF file generates it (this could actually be handled by RDLC). So that when the user clicks the link button, they are taken to this display page, from which they can download the PDF version if they want a local copy.
Regardless of how you generate the PDF, I have found a better user experience if you open the PDF in an IFRAME instead of the full browser window. You can give users instructions and maintain the browser navigation.
I think what you want to do is by going to: http://my_site.com/generate-pdf.aspx?=someId
this should in fact just show the PDF file?
What you need to do is change the Response type.
See here for how to do this with images.
Look up the Content-Disposition HTTP header. You can send back a value that requests the content be displayed inline instead of downloaded.

Using ASP.Net, is there a programmatic way to take a screenshot of the browser content?

I have an ASP.Net application which as desired feature, users would like to be able to take a screenshot. While I know this can be simulated, it would be really great to have a way to take a URL (or the current rendered page), and turn it into an image which can be stored on the server.
Is this crazy? Is there a way to do it? If so, any references?
I can tell you right now that there is no way to do it from inside the browser, nor should there be. Imagine that your page embeds GMail in an iframe. You could then steal a screenshot of the person's GMail inbox!
This could be made safe by having the browser "black out" all iframes and embeds that would violate cross-domain restrictions.
You could certainly write an extension to do this, but be aware of the security considerations outlined above.
Update: You can use a canvas utility function to get a screenshot of a page on the same origin as your code. There's even a lib to allow you to do this: http://experiments.hertzen.com/jsfeedback/
You can find other possible answers here: Using HTML5/Canvas/JavaScript to take screenshots
Browsershots has an XML-RPC interface and available source code (in Python).
I used the free assembly UrlScreenshot.dll which you can download here.
Works nicely!
There is also WebSiteScreenShot but it's not free.
You could try a browser plugin like IE7 Pro for Internet Explorer which allows you to save a screenshot of the current site to a file on disk. I'm sure there is a comparable plugin for FireFox out there as well.
If you want to do something like you described. You need to call an external process that prints the IE output as described here.
Why don't you take another approach?
If you have the need that users can view the same content over again, then it sounds like that is a business requirement for your application, and so you should be building it into your application.
Structure the URL so that when the same user (assuming you have sessions and the application shows different things to different users) visits the same URL, they always see same thing. They can then bookmark the URL locally, or you can even have an application feature that saves it in a user profile.
Part of this would mean making "clean urls", eg, site.com/view/whatever-information-needed-here.
If you are doing time-based data, where it changes as it gets older, there are probably a couple possible approaches.
If your data is not changing on a regular basis, then you could make the "current" page always, eg, site.com/view/2008-10-20 (add hour/minute/second as appropriate).
If it is refreshing, and/or updating more regularly, have the "current" page as site.com/view .. but allow specifying the exact time afterwards. In this case, you'd have to have a "link to this page" type function, which would link to the permanent URL with the full date/time. Look to google maps for inspiration here-- if you scroll across a map, you can always click "link to here" and it will provide a link that includes the GPS coordinates, objects on the map, etc. In that case it's not a very friendly url but it does work quite well. :)

Resources