Jump to content

Printing - # lines used?


paruby

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
Link to comment
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.
Link to comment
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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.