Solved

Python Printing

Posted on 2001-08-01
5
354 Views
Last Modified: 2010-04-17
I would like to print HTML pages on a printer.but the problem is that it should be printed as A4 size pages and if the content exceeds A4 size it should be moved to next page.Since I am using python kindly help me out on this
0
Comment
Question by:sivaramancbe
5 Comments
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
ID: 6347747
An HTML page will print how it prints. You cannot adjust the clients browser to have them print the way you want.

I might misunderstand the question. What exactly is it that you are trying to do. Is there a browser involved, how do you get to the pages, where and how does python step in etc. etc.

regards,
CJ
0
 

Author Comment

by:sivaramancbe
ID: 6347759
Hi Cj,
This works on IE and a http server has been created using python to stream the data as HTML.
The only thing now I require is can i organize the data using some code and print it according to A4 size
With Regards
Shiva
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6347794
On the client I assume? No, you cannot access the client browsers settings. Javascript and VBScript are the only scripting languages with which you can reach the client. However, both have been designed with security in mind. meaning that you cannot set or access any specific settings of the client. That includes the way their print settings are set.

I'm sorry, but you cannot do this. There have been umpteenth similar questions with only negative answers related to these printing issues.

There is only one thing you can do which can affect the browsers print-settings...and that is by using style sheets to tell the browser how to print a page.

Example:
<style type='text/css'>
P { page-break-before: always; }
</style>

If you add that to the HTML page a page break will ALWAYS be set when you use the P-tag (<P> ... </p>)

there is also a page-break-after. Experiment some with it. it is IE only, and the ONLY way you can tell the browser how to print certain ways. Printer settings themselves cannot be changed!
 

regards,
CJ
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7487668

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - Answered by: CJ_S
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7518976
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scores100 challenge 3 83
changePi Challenge 15 76
How Complex Is This Java Course ? 9 63
Adoquery sql  left join does not work 25 46
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now