- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: line wrap or truncate when printing web page p...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2007 08:44 AM
тАО01-09-2007 08:44 AM
.
In the browser, long lines display fine, - user can scroll right to view long lines. But if the user prints the page, the long lines get truncated. I need the lines to be wrapped, not truncated, when the page is printed.
Is there a simple way around this? I don't care whether it gets adressed as a browser (IE) setting, a printer page setup change, a different way of generating the web page, etc. Just hoping it can be accomplished with a simple change.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2007 09:07 AM
тАО01-09-2007 09:07 AM
SolutionI think you need to "smarten" you code. Instead of invoking the external 'cat', open and read the file into an array. Assuming that you can compress whitespace and/or split lines, use the 'Test::Wrap' module (available in the core distribution) to reduce the margin's extent. If the data is columnar with fixed whitespace widths, you may be forced to reading and reformatting it yourself.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2007 09:13 AM
тАО01-09-2007 09:13 AM
Re: line wrap or truncate when printing web page produced by perl pgm
My first step woudl be to isolate the problem into two parts.
part 1) The perl script to generate the HTML.
part 2) a Browser displaying and printing the page.
In between you have the html file.
Study that with vi or some such.
Is it exactly what you want it to be?
If not, fix the perl,
be first make it how you want it to be with an editor and verify it works as intended.
If the html looks alright, as intended, then it is not a perl/hpux question but an html language question. (What does PRE do? Don't you need a
around paragraphs? )
No go get a bunch of wet noodles out of a cupboard and wack yourself on the hands a few times for extremely poor programming style.
It's just not reasonable to fork a process (backtick); activate a program (cat); make it read a file, send it to a pipe to then have perl read it from that pipe when perl can just read the file directly and with much better options for error handling!
It's... it's.. dare I say this... embarrasing to do otherwise
Just use something like:
$file = shift; # or wherever else you get the name from.
if (open (HTML, ">$html") {
print HTML "
\n" # and more ?
if (open( FILE, "<$file")) {
while () {
print HTML $_; # yes you can write this faster
}
} else {
# input file error handling
}
} else {
# html file create error handling
}
Good luck!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2007 10:33 AM
тАО01-09-2007 10:33 AM
Re: line wrap or truncate when printing web page produced by perl pgm
I'll see what I can do with Text::Wrap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2007 11:50 AM
тАО01-09-2007 11:50 AM