Question : Printing directly from a webpage and printer settings.

Hi,

I want a printer friendly webpage in landscape layout which when printed using a print button on the webpage should directly get printed in landscape layout in the System's default printer.

To eloborate:
The page is ".asp". Browser is IE6.

The printer friendly version of this page should be printed with the landscape size settings.

The asp will access a database and rerieve records to be displayed. These records are displayed in a table with headers.
(for eg. SlNo - Name - Description)
The resulting printer friendly page should also have page breaks. And the table should have headers for everynew page.

Finally, say we have a button "Print" at the end/top or the printer friendly webpage, clicking this button should start printing these pages in landscape mode without invoking the Printer dialog of the browser.

I used style sheet and could change the page size by swapping width and height. This got me the landscape mode in the browser. But when I printed the webpage it printed only in portrait mode.
I dont know how to get printer friendly webpages and how to set the printer settings for a one print job from a script or whatever.
I tried to use "templatePrinter" for printing which I found in MSDN. But, the method "printer.printpage" gives me a permission denied error. So, I dont know why would that come now.


If your solution works on IE6, thats enuff.

Hope somebody can figure a wayout.

GLIVIE.

Answer : Printing directly from a webpage and printer settings.

Hi GLIVIE:

You can try this - you'll need to adjust the settings obviously...

Use the writing-mode property instead. A value meant for East Asian typography, tb-rl, causes IE (5.5 and newer) to write text from top to bottom and right to left. Surround the content you want in landscape with a DIV and a class as defined in the print stylesheet.



Landscape Printing




Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto.






>> The resulting printer friendly page should also have page breaks. And the table should have headers for everynew page.

You're now pushing the limits of how a browser can control a printed page. You may have already exceeded them. You really will need to create a PDF file from the dynamic data to pull this off...
Random Solutions  
 
programming4us programming4us