Jump to content

MySql data for print


dppls

Recommended Posts

Hello All,

 

This is my first post.

 

I currently have some dynamic data to put on a webpage. I've done this like 1000 times, but the problem is that we need for this website to show in 3 columns different elements and for it to fit in 1 page, when printed.

 

I thought it would be easy by simply determining constant spaces for each element I got from the database, but it turns out, some have logos, some don't have text at certain places, and the user doesn't want whitespaces for nothing...

 

So all in all, is there a way to count where I am at and determine when I should create a new page or is this all too dynamic for a static structure...

 

I though I could determine also by counting the number of caracters I'm printing out, and the size of the logos, but the caracters have different widths and kernings, they aren't static, so that is yet again a dynamic factor...

If you need details, don't hesitate to ask...

Link to comment
Share on other sites

Really isn't a php question, more of a layout/css issue, however there is a php solution.  One such solution would be to take the document and transform it to a pdf (via the link to print) that would generate a very nice printout for you that would be up to date.  Second option which is easier is just use css to for the layout to be X pixels wide where X is how many pixels fit on your sheet of paper.  Then just distribute X over a,bc where a b and c are the 3 column's width.  This is a lot easier than making the pdf every time.  There is no point in count characters and so forth because then your layout will get too complex, and the content will never look the same.

 

I re read your post and see your talking about dynamic graphs, are these comming off a database, if this si your issue, just force the issue on the graphs to make them a set width upon being stored (GDlibrary can assit with that)  that why they will always fill their container to the max width thus reducing whitespace, however whitespace is a design feature not a problem and maybe you can explain this to your client that whitespace = good.

Link to comment
Share on other sites

Thanks for the quick answer!

 

I believe I might not have explained it truly well though, so I will try again.

 

You are right about the distribution of columns and such...

But the problem is with the page breaks when printing. But when do I know I have to do so if all the content is dynamic?

 

Maybe that will help a little?

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.