Jump to content

Archived

This topic is now archived and is closed to further replies.

paruby

Printing - # lines used?

Recommended Posts

I know I can have approx 38 lines of text for a 1 page print out. I can keep track of the # of items I print out that are on their own line. Question is, how can I know if an item takes up 2 or more lines?

Thanx in advance...

Pete

Share this post


Link to post
Share on other sites
You could count the sections based on xx number of characters per line. You could take each line as you have it divided already and then if it is divisable by xx number of characters the result is how many lines it covers. You can use wordwrap to divide the section into lines based on your criteria. If you need some examples, let me know, but for the moment I must head out the door.

Share this post


Link to post
Share on other sites
It is incrediably difficult to control any printing from php. PHP is server side and what happens client side is an different story.

NOW printing is not the same world-wide I am informed that those in the US don't use the A4 size - predominant in european countries.

You absolute best route of atck on this is to use a style sheet. just like anyother style sheet you can create one just for printing by adding the media="print" to the end of the link tag in the head section.

Even then you are not guaranteed exactly what you want different printers and different drivers can alter margin sizes (although you can set them in your style sheet), and any number of default settings that you just cannot account for.

Share this post


Link to post
Share on other sites
thanx, both suggestions are helpful... One final question, is there a way to force a new page?

Share this post


Link to post
Share on other sites
I am sure there is probably a way, but I honestly don't know. The best thing I can say is to add line feeds/carriage returns. Like ToonMariner said, controlling printing from PHP is tricky. I don't work a lot with printing, so I don't know a whole lot about working with printer output from PHP and because of this there is probably an easy way to do it that I just don't know about. If someone has a quick and easy solution, I'd love to know about it just for kicks and grins.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.