?
Solved

Python Printing

Posted on 2001-08-01
5
Medium Priority
?
367 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression

850 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