Solved

Python Printing

Posted on 2001-08-01
5
357 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C Programming - If Statement 8 76
silent install of security banner via msiexec command 4 86
Apps blocked by Java 9 79
How to Convert a Quote to an Order in SalesForce 2 35
A short article about a problem I had getting the GPS LocationListener working.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

816 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

10 Experts available now in Live!

Get 1:1 Help Now