I have a print button in PHP page which using javascript
window.print() to print web page.
However , when user click "print" , the print preview display that the
page cut-off and alignment is out.
Read on regarding the matter , and found that is not the issue of PHP .
Some users recommend to me to use CSS and HTML to create printer
friendly page.
However my page is extension is in php , can i use CSS and HTML to
create printer friendly page?
I am developing a site for a client that requires the printer friendly verison of the site to appear in a separate pop-up window. I am having trouble figuring out the scripting needed to have the current page open in a separate window with a different style sheet applied to it.
I'm battling to print labels on a dot matrix printer. The available page sizes are all bigger than a single label and I can't make custom page sizes on this printer (panasonic KX-P1150). Whenever I print a label, the printer form feeds the label paper and does not stop after the label. I have googled and see that printer comands can be send directly to the printer with ActiveX controls from inside a javascript but the only examples I found changed the orientation etc. None changed the page size or disabled the form feed.
I want to let users to print an automatic generated image from a web page. the problem is that the image is big (little smaller than A4) and if I print the page from "File --> Print" the image is automatically resized or printed in more than one page, if I set the page properties from the File menu I can reduce print margin and cut off header and footer, and then it works fine. So I would like to set page properties form javascript to let users print the image with right dimensions.
The coloumns of the tables in my jsp page have links on them for sorting. The same table is displayed in the printer freindly version but i want to disable these sorting links on that printer freindly page.
many framed sites have an ancient script in all their pages: if(top==self) top.location=theframeset
Some friendlier ones do this: if(top==self) document.write( '<a href=frameset>This page is ' + 'supposed to be frames</a>.' )
These scripts fail when the page is loaded within somebody's else's frameset.
Then top is not self but not a very cooperative top either. And with ever growing security issues browsers have become quite paranoid. Even testing for top's origin results in an error:
alert(top) // gives me [object] var s='' for (var i in top) s+=i+' '+top[i]+' ' alert(s); var obj; try{ obj=top.location; } catch(e) { obj='' } // give me [access denied] (of course)
I 'd rather drop the frames altogether, but the site has been like this for years and the client insists. There are frames. So how would I detect when it is appropriate to write:
<a href=>View this page in its <b>own</b> frames.</a> ?
Question b: in the frameset, a little script looks into self.location.search for an url with which to fill the main frame. Is there a way to avoid document.write and onload?
When the user clicks on the password form field, the background image is suppossed to be replaced with a white background color. All I get is a javascript error, and I copied straight out of the newsletter.
I have an html based website that needs urls converted from [URL] to [URL] the website has no mysql database. the urls are written through javascript. download from below the js + html files Code: [URL] urls writing rules can be found on common.js and set_form_menu.js.gz files
I need to take text from a database, turn it into a barcode from the Web and print to a Zebra Z4M barcode printer. I am stuck at two separate approaches.
1. Use ZPL II (Zebra's proprietary language to command the printer) which is executed at a DOS Prompt with "COPY BarCode.txt LPT1" Is there any way to run that from the web. Also, is there any other method of sending the information in the text file to the printer?
2. Use some sort of ActiveX object to compile a barcode label image, then use another ActiveX object to remove the Header/Footer and Margins from the IE printout. I have found ActiveX objects that can compile the image, but have not found anything to block out the Header/Footer and Margins.
I have one image (sampleImage.png).. Already i connected my pc to printer....Manually i open the image and select print option , then i got image from printer....Now i want print image using javascript....
so my professor suddenly took a left turn in class and we jumped from using HTML and CSS to programing in Javascript. It's not even covered in the book we're using for a text book. So I'm having some problems with it (big surprise right?) My assignment: Write a Java Script that will print out the Temperature in Celcius from 0 to 35, AND the corrosponding temperature in Fahrenheit. So basically it would generate the following:
0 Degrees in Celcius is Equivalent to 5 Degrees Fahrenheit 1 Degrees in Celcius is Equivalent to 6.125 Degrees Fahrenheit 2 Degrees in Celcius is Equivalent to 7.25 Degrees Fahrenheit 3 Degrees in Celcius is Equivalent to 8.375 Degrees Fahrenheit and all the way down to 35 degrees.
Looking over other threads on this site I was able to use another members script to build my own for adding a network printer via JavaScript on our Intranet. With that, the script works perfectly fine when testing it on the local machine I built it on, but not on other machines in the office. Currently I'm remoted into the branch office I reside in from the corporate office where I'm currently at so the machines being tested are on different subnets, but the script is simple calling the UNC path for the printer. When tested on any other computer, and the link is clicked on the page, the user is taken back to the folder in windows explorer the HTML file is saved in, rather than executing the add printer portion of the script.
This is my full code as of now, I was trying to get the function correct before formatting the actual website (obviously) Code: <html><head> <meta http-equiv="Content-Language" content="en-gb"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Printer Mapping</title> </head> <script> function addPrinter25(){ var x=confirm("You are about to add printer GPSACC01. Would you like to make this your default printer?") if (x==true){ WshNetwork = new ActiveXObject("WScript.Network"); var PrinterPath = "\\gpsprnt02\gpsacc01"; WshNetwork.AddWindowsPrinterConnection(PrinterPath); WshNetwork.SetDefaultPrinter(PrinterPath); alert("Printer GPSACC01 has been added successfully and set as default") }else{ WshNetwork = new ActiveXObject("WScript.Network"); var PrinterPath = "\\gpsprnt02\gpsacc01"; WshNetwork.AddWindowsPrinterConnection(PrinterPath); alert("Printer GPSACC01 has been added successfully") }} </script> <font color="#0000FF" face="Arial"> <a href="" onclick="addPrinter25(); return false;">GPSACC01</a></font> </body></html>
Here is my code that works flawlessly in IE but I can't get it to work in firefox. what firefox doesn't like about this code?
<SCRIPT language="JavaScript" type="text/javascript"> //POPULATE COMBO BOX PER RADIO BUTTON CHECKED function UpdateCombo() {
[code]...
Now, I obviously left unrelated code out here; but that code is the basic of what Im working with, but the combo box is just empty in firefox. Works fine in IE; so I'm guessing it doesn't like something with the code:
I've added the most basic implementation of JQuery tabs. It's working fine so long as there's not a url-friendly query string.In other words, if I load index.php, it will work fine. Even index.php/anystring doesn't have any problems. However, if I try to load something such index.php/anystring1/anystring2, none of the CSS styles for the tabs appear to be applied to the tabs list making all the tabs' contents appear on the same page.how I can work around this to ensure I can preserve the current format of query string without breaking the tabs? Using the old fashioned way doesn't appear to result in any problems, but I'm trying to avoid having to revert to that format.
want to print some data using dot matrix printer on pre printed receipts,am using PHP and MYSQL database am getting data FROM DB , now am not getting how to align it, how to print using java script, exactly on those boxes on pre printed reciepts , please any provide me the code
when i load page it does nothing only blank page, may have code in wrong place but not sure so can someone show me a working example so i can find out what i'm doing wrong also i would like the part of page to refresh evey 120 seconds is this possibe with jquery?
I've got 2 pages: a current events page and a past events page the current events page loads fine as there is only about 10 events the past events page takes about 30 seconds to load and will crash if u click your mouse in the loading time.
The pages are near identical the only difference is the query that selects the events (> versus <)
The page loads immediately without:
But when i put it back in the above happens. I'm using jQuery.roundedcorners.