I'm developing a billing software. Can print a receipt but again click print button in print page then only printing
For Ex:
I'm clicking print button in HTML page,
next automatically open google chrome print window.
and again click print button,
Now printing, I want to be print directly. How to remove 2nd and 3rd step via programmatic.
How to rectify this problem anyone help.
<script type="text/javascript">
function printpage()
{
window.print();
}
</script>
I'm using above code this is output is redirected to google chrome print page.
And Again click print button then only printing,
I want to be print directly
For example am click print button in HTML page means automatically printing.
Cannot ask any inputs.
And cannot display any other dialog boxes.
Anyone help me please.
Explaining
am click print button in HTML page: Yes you will have to click on print button to request the browser to perform an action
next automatically open google chrome print window: Of course, it will be opened as printer/page settings will be asked even in ms word same thing happens while printing it asks for preferred printer & page
and again click print button: Finally you will be asked to submit your confirmation
Understand the whole process & please being on SO don't make a wish
you need to develop desktop based application that connect your web to your computer..
so your web cant request directly to your desktop program instead via browser...
you can use java applets to do that...
Related
In C# Selenium, after clicking on a button a print preview popup will appear as in the attached image. In case of failure this will not appear and I will use the page elements to find that the test case is failed.
Now in the success scenario, I need to check whether a print preview popup is appeared or not. If YES i need to click on CANCEL button in that print preview popup and verify the page content which is behind the popup. Unfortunately Selenium doesn't identifies the content behind the popup until the popup appears..
Can anyone help me out to solve this problem in C# Selenium.
Web page opens fine inside my WebView but it doesn't respond to print button that is present in webpage. When I click on that printbutton from desktop browser it opens the print interface of browser where I can save the file as PDF. I want to do that same, I have searched a lot but could not find any information, how I can do that?
Normally window.print() is used printing webpage, it trigger print dialog box of browser.
Now my question is how can we bypass this printing dialog box and directly print the web page? is there any way by I could avoid to click on OK button?
Nowdays I believe you could avoid the print dialog from any application by using some cloud printing REST API. So far I only know of PrintNode and Google Cloud Print:
https://www.printnode.com/docs/api/curl/
https://developers.google.com/cloud-print/docs/appInterfaces
Hope this helps.
I have a website, but I need a button which I want to print a specific .pdf file from my webpage database.
As an example, this site
has a print button, which gives you option to print some pdf files
Any idea how can I do that?
I've tried this one, but it's not working:
<a href="../Documents/ScrittoGraffito/Scritto_Customers/Nicolaides_Optical/Nicolaides_webpage/Shop1_Banner.pdf"
onclick="window.print()"/><p class="test">link</p></a>
That code will tell the browser to open the print dialog for the current page.
If you want to force the browser to print the linked pdf then that is not possible, as it will be completely controlled by the application or plugin that handles pdf documents.
EDIT;
Apparently it is possible, but you have to make use of a pdf toolkit.
Every browser has print preview command in their File menu I want to make "print" button on HTML page and upon clicking i want to open print preview page. is this possible?
With this we can open print options
Print this page
but can we open print-preview page instead print options ?
window.print() is the only print-related function in window.
However, if you have defined a dedicated css-file for print, you can create a page that simulates a print-preview by only using the print stylesheet. And then open this in a popup or new window.
No you can't. However there is a way to show that in IE by using ActiveX and some others for other browsers...