forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Printing in Landscape format

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Mon Feb 27, 2006 1:11 pm    Post subject: Printing in Landscape format Reply with quote

I'm running around in circles and don't seem to be getting nearer the solution, so I guess it's time to put my question to the VDS thinktank Laughing

In a program I have a print preview window which in fact shows html formatted list data. I want to print this output so I made a button on the vdssurfx window which uses SHELL PRINT to output the file to the printer.
What I really want is to force this output to be printed in landscape format.

Anyone any idea how I can get the print operation to default to landscape format?

Confused
Jan
Back to top
View user's profile Send private message Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon Feb 27, 2006 5:55 pm    Post subject: Reply with quote

Orientation is sent to the device as part of the DevMode dataset so while it wouldn't be impossible to do this from VDS it would certainly take some work, perhaps a good candidate for a new extension.

MSDN DevMode Link:
[url] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8nle.asp [/url]
Back to top
View user's profile Send private message Send e-mail
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon Feb 27, 2006 8:47 pm    Post subject: Reply with quote

Sorry I just thought of this: Since your data is HTML formatted you might try Cascading Sylesheets to print in landscape format from a CSS aware browser.

Link:
http://www.w3.org/TR/css-print/


Example HTML:



csslandscape.zip
 Description:

Download
 Filename:  csslandscape.zip
 Filesize:  423 Bytes
 Downloaded:  1152 Time(s)

Back to top
View user's profile Send private message Send e-mail
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Mon Feb 27, 2006 10:49 pm    Post subject: Reply with quote

That sure sounds like a possible solution.
I use HTML to be able to print formatted output but never thought of CSS.
I'll dig into that tomorrow.

Thanks!

Very Happy
Jan
Back to top
View user's profile Send private message Visit poster's website
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Tue Feb 28, 2006 7:13 pm    Post subject: Reply with quote

Alas !
I have mixed results with this sample stylesheet.
In my html page there is a table with a number of columns and packing everything between a DIV and /DIV results in the header being printed in landscape, then the table is printed on a second page in portrait and finally the footer is on page 3 in landscape format again.

So there is progress but now my problem is how to get everything
printed landscape on a single page?

This is a summary of the html i used:
Quote:

<html>
<head>
<style type="text/css" media="print">
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
.noprint {display:none;}
</style>
</head>
<body>
<div class="page">
<font size="+2"><b>%%DatabaseDescription</b></font>
<hr align="left">
<table width="1000" border="0" summary="">
<tr>
<td>
.....
.....
</td>
</tr>
</table>
<br><br>
<hr align="left">
Number of records in this database: @DATABASE(COUNT,1)
</div>
</body>
</html>


Confused
Jan
Back to top
View user's profile Send private message Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Tue Feb 28, 2006 8:05 pm    Post subject: Reply with quote

It would appear that your Table width "1000" is beyond the printable bounds of the page. Try using a smaller width value or better yet a percentage value.


Code:
 <table width="100%" border="1" summary="">
Back to top
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Mar 03, 2006 11:28 am    Post subject: Reply with quote

yea, I allways used 99%, but maybe I'm too old fashion.
Back to top
View user's profile Send private message Visit poster's website
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Fri Mar 03, 2006 8:21 pm    Post subject: Reply with quote

I tried the 100% solution but the effect is not what I hoped for.
The header is not printed at all, the table is printed on one page in portrait and the footer is printed on a second page in landscape.

I hope someone has any more bright ideas to get this landscape printing going, because I can't find a solution at the moment.

Confused
Jan
Back to top
View user's profile Send private message Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Sat Mar 04, 2006 10:50 pm    Post subject: Reply with quote

Sorry I guess that doesn't work on tables Embarassed

This link shows an example with tables:
http://web.tampabay.rr.com/bmerkey/examples/landscape-test.html

Uses: filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=1);

I haven't tried it myself but the example page printed correctly.
Back to top
View user's profile Send private message Send e-mail
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Mon Mar 06, 2006 5:29 pm    Post subject: Reply with quote

It's amazing ..... I downloaded that Landscape demo webpage and saved the source. Now one time it shows the pages correctly in the print preview but another time the same (i=unchanged) source shows the table in portrait again.
I also changed my own html source accordingly but that still won't print tables in landscape.
First I suspected that using bold in the table caused a problem but with or with bold makes no difference my html table never prints in landscape.

I'm baffled that something this simple can be so hard to achieve.
Still going to experiment further with stylesheets but if anyone has more ideas they are most welcome.

Mad
Jan
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Tue Mar 07, 2006 11:52 am    Post subject: Reply with quote

I tried it here with 100% printed same as the preview, but maybe it needs the rest of the stuff to see what you mean.

Code:
<html>
<head>
<style type="text/css" media="print">
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
.noprint {display:none;}
</style>
                   
<!--
.noprint {display:block;}
 -->   

</head>
<body>
<div class="page">
<font size="+2"><b>%%DatabaseDescription</b></font>
<hr align="left">
<table width="100%" border="0" summary="">
<tr>
<td>
.....
.....
</td>
</tr>
</table>
<br><br>
<hr align="left">
Number of records in this database: @DATABASE(COUNT,1)
</div>
</body>
</html>
Back to top
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Mar 08, 2006 9:29 am    Post subject: Reply with quote

Perhaps the landscape style isn't inherited to your table cells - try to make a new style
TD.land { writing-mode: tb-rl; }
and set your table cells to that one: <TD class="land">

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Mar 08, 2006 9:42 am    Post subject: Reply with quote

.. and due to the reversal made with the style sheet (you'll print right-to-left) you may have to structure
your table differently:

Code:
<html>
<head>
<style type="text/css" media="print">
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
TD.land { writing-mode: tb-rl; }
</style>
</head>
<body>
<div class="page">
<font size="+2"><b>DatabaseDescription</b></font>
<hr align="left">
<table width="100%" border="1" summary="">
<tr><td class=land> Rec2 1st cell </td><td class=land> Rec1 1st cell </td></tr>
<tr><td class=land> Rec2 2nd cell </td><td class=land> Rec1 2nd cell </td></tr>
<tr><td class=land> Rec2 3rd cell </td><td class=land> Rec1 3rd cell </td></tr>
</tr>
</table>
<br><br>
<hr align="left">
Number of records in this database: @DATABASE(COUNT,1)
</div>
</body>
</html>


Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Mar 10, 2006 10:28 am    Post subject: Reply with quote

I tried the TD class when it was 1000px with no difference, but I bet thats what he needs while at 100% with the reversal(which I didn't try), your prolly right Dread
I'm still learning CSS and xhtml, so I'm bailing outta here now Arrow
Back to top
View user's profile Send private message Visit poster's website
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Sun Mar 12, 2006 12:21 am    Post subject: Reply with quote

Thanks Dread!

Now I indeed have a table printed landscape blended in with the rest of the landscape lines.
But now - as you already said - a new problem arises because the HTML preview and the printed version are totally different.
In preview you see rec1.column1, rec1.column2, rec1.column3 on one line (as intended) but printed you see all columns of rec1 displayed below each other in tabel.column1, all items of rec2 in column2, etc.
So this CSS can be useful now it's figured out but it means that between preview and printing all data has to be reread in a different HTML file to get the row and columns right. Data from one record will have to divided over different HTML table rows to get it right. Which means that reading in the second record will mean lines will have to be inserted in the HTML file at the proper locations instead of just being added at the end of the HTML file.
Well ....... you can't win em all Rolling Eyes

Jan
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group