944,050 Members | Top Members by Rank

Ad:
Sep 5th, 2007
0

Query regarding .css files.

Expand Post »
I'm having a bit of trouble figuring something out. I have a css file I use to attempt to break pages in the correct spot, and to force a landscape print so as to ensure that the words on the web reports my php program builds aren't packed together when printed out. The following is a complete copy of the text of the css file I use to
do this-

HTML and CSS Syntax (Toggle Plain Text)
  1. p { page-break-before: always;}
  2. @page
  3.  
  4. {
  5. size landscape;
  6. }
The css file is called from my program with the following command-
HTML and CSS Syntax (Toggle Plain Text)
  1. echo '<link rel="stylesheet" type="text/css" href="cancelheader.css"/>';
For some reason, I'm now having trouble getting this to work on a new program. As far as I can tell, the only differences are that a) the new program includes others that also make use of the page-break function, and b) the new files are in a different directory from the original css file. A copy of the css file has been placed in this directory, however.

Before, I've always used a single php file; now, I've got three separate files that get called from a single higher one. With this program, I cannot get the pagebreaks to occur when they are supposed to according to the css file.

I have tried the following to attempt to solve this:
1) Each of the original files included the reference to the css file. I commented those out, leaving instead a single copy in the higher-level file that calls(includes) them. This has not helped. Even a <p/> tag within the higher-level file does not break the way it should.
2) I tried to clear the cache, in hopes of solving the problem that way. This has not worked.
3) I closed down all browser windows (I thought this only applied to sessions, but I wanted to make certain) then opened up a new one and loaded the page again. This did not work.

I am using Firefox, version 1.5.0.12, to load the page.

Does anyone have any suggestions what my problem here might be, or solutions as to other things I can try to solve it?
Similar Threads
Reputation Points: 483
Solved Threads: 1
Posting Shark
EnderX is offline Offline
999 posts
since Aug 2006
Sep 7th, 2007
0

Re: Query regarding .css files.

erm...tricky are you sure your href is going to the right file and doesnt need jumping in or out (../)???
Reputation Points: 12
Solved Threads: 16
Posting Whiz
Designer_101 is offline Offline
314 posts
since Jul 2007
Sep 7th, 2007
0

Re: Query regarding .css files.

There is a copy of the .css file in the same directory as the files that are calling it.
Reputation Points: 483
Solved Threads: 1
Posting Shark
EnderX is offline Offline
999 posts
since Aug 2006
Sep 7th, 2007
0

Re: Query regarding .css files.

I cant see anything wrong with your code and the placing of it, nor your browser and anything else??? sorry im confused at this one.
Reputation Points: 12
Solved Threads: 16
Posting Whiz
Designer_101 is offline Offline
314 posts
since Jul 2007
Sep 9th, 2007
0

Re: Query regarding .css files.

The choice of portrait or landscape printing belongs to the owner of the computer browsing your page, not to you.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Sep 10th, 2007
0

Re: Query regarding .css files.

@MidiMagic:
In this case, the choice belongs to my boss, who tells me what needs to be put on the page, that the results have to be printable from the browser to paper, and that the page needs to be made to look neat on paper. Unless the browser's going to shrink the results for me, these aren't compatible with portrait formatting. Too many items.

@Thread:
Found the problem...simple PEBKAC error in the code. I'd somehow forgotten to close off a set of table tags.
Reputation Points: 483
Solved Threads: 1
Posting Shark
EnderX is offline Offline
999 posts
since Aug 2006
Sep 13th, 2007
0

Re: Query regarding .css files.

But your boss can't override internet security, or the law, or the limitations of the hardware attached to the computer.

That choice is the PROPERTY of the user. It belongs to him, because his computer belongs to him. Those settings are permanently part of his computer, not your web page. They are in his printer driver, not part of the browser or the web page. When you make that choice in the browser's FILE menu, you are really talking to the printer driver, and using the printer driver's own dialog box.

Also note that some printer drivers do not HAVE a landscape setting, because the printer can't DO landscape. You can't assume that everyone has a LaserJet or a Lexmark. A relative's computer still has a daisy-wheel printer. The "landscape" mode requires her to physically move the paper guides, put the paper in sideways, and select "landscape 11 X 8.5 paper" from the paper choices. There is no way to just select "landscape" on that computer and have it work.

Your boss can blow his little top off, with steam coming out his ears, but he can't change the law, the rules of internet security, or the limitations of the user's computer hardware. So you should have a camera ready, so you can photograph the steam when he finds these things out.

If you do find a way to do this, you could be violating federal law. And if you were ordered to crack into the user's computer so the boss can have his way, then the boss can be charged too.

The only right way to do this is to ASK the user to change his settings to landscape before printing the page.
Last edited by MidiMagic; Sep 13th, 2007 at 4:04 pm.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Sep 14th, 2007
0

Re: Query regarding .css files.

I am not assuming that everyone can do this, MidiMagic. I am assuming that a specific individual, one of the upper-level staff for the company that retains my own for its IT purposes, when using an internal business form, has access to at least one business printer that can do this, and to a browser that can parse and use the CSS2 tag. Failing the tag, there won't be any changes and the system will print out in portrait style. I don't have to break into the other system, merely to have a specific piece of pre-defined CSS2 code in place in my own .css file. I fail to see how that violates the law.

Or are you somehow suggesting that the CSS2 code itself is illegal? I'll be happy to bring the topic up in the Geek's Lounge for discussion if that is the case.
Last edited by EnderX; Sep 14th, 2007 at 9:33 am.
Reputation Points: 483
Solved Threads: 1
Posting Shark
EnderX is offline Offline
999 posts
since Aug 2006
Sep 18th, 2007
0

Re: Query regarding .css files.

An intranet is different. But you didn't say anything about that.

I was thinking of an advertising page where your boss wanted to change the printer settings of every user who accesses the advertising page. That would be illegal cracking

Although a CSS tag which selects landscape for just the one print job is a great idea, provided the printer can actually do landscape. It doesn't permanently change the settings.

If you are doing print to a network printer, you can put this in the settings for the network printer.

I have had too many trials in the past where I had a special printer set up, with special values in the driver registers, and then the application software comes along and resets the printer driver to "standard", destroying the settings necessary to use that printer. Or their reset destroyed the offset of the tractor-feed paper in use.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: How to: Excel Spreadsheet online??
Next Thread in HTML and CSS Forum Timeline: Firefox left-marin problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC