Solved

Python Printing

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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 …

733 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