|
-
Nov 28th, 2005, 02:34 PM
#1
Thread Starter
New Member
[RESOLVED] printing upside down
How can I make a few lines of text print upside down in a paper? The thing is there is this form paper which must go into the printer feeder upwards, so that you need to print on it upside down.
Is there a setting for this (like "landscape" for printing sideways)? or some workaround?
Thank you very much for your help.
-
Nov 28th, 2005, 04:20 PM
#2
Re: printing upside down
Can't you just flip the paper?
-
Nov 28th, 2005, 04:30 PM
#3
-
Nov 29th, 2005, 09:43 AM
#4
Thread Starter
New Member
Re: printing upside down
 Originally Posted by RhinoBull
Can't you just flip the paper? 
No because on the top of the form paper there is some kind of glue and if this edge goes first on the printer feeder there is a big probability that the paper will not enter correctly.
There must be some way to send things to the printer rotated by 180 deg, no?
-
Nov 29th, 2005, 10:14 AM
#5
Re: printing upside down
What is your document ?
How are you printing it ?
Do you need mixed-mode ? (some lines upside down, some lines straight ?)
-
Nov 29th, 2005, 10:43 AM
#6
Thread Starter
New Member
Re: printing upside down
What I need to print is an image with a logo and a couple of text lines.
This will fit on a single page and everything (image and text) should be printed upside down on the page because of the way the paper goes into the printer feeder.
How to print this is what I'm trying to figure out...
I have no experience in printing with VB, but from what I've read in the forum an option could be using a richtextbox to format the page, right?
Then I just have to send the formatted page to the printer upside down...
How to do this? I really appreciate any help.
-
Nov 29th, 2005, 10:53 AM
#7
PowerPoster
Re: printing upside down
Have you checked the properties for your printer? I have some SATO bar code printers and I can tell the printer to flip everything 180 degrees.
-
Nov 29th, 2005, 01:27 PM
#8
Re: printing upside down
Here is a code that can print RTB contents upside-down. Put your picture and text inside a RichTextBox and use it.
Basically what it is doing is, printing the RTB contents to a picture using RTB's .SelPrint method, then flipping the picture using picturebox's PaintPicture method and finally it is printing the picture using Printer.PaintPicture method.
This code is not 100% full-proof. You may need more RTB formatting code. See the How to set up the RichTextBox control for WYSIWYG printing article in MSDN.
VB Code:
' Paste this code in a Form.
' Add 2 pictureboxes - [b]picSource[/b] and [b]picDest[/b]
' Add a richtextbox - [b]RichTextBox1[/b]
' Add a command button - [b]Command1[/b]
Private Sub Command1_Click()
' Resize RTB --->
With RichTextBox1
'[b]Set ScrollBars = rtfNone at designtime[/b]
.Width = Printer.ScaleWidth
.Height = Printer.ScaleHeight
.SelStart = 0
End With
'--------------------------------------
' Resize picSource --->
With picSource
.Width = Printer.ScaleWidth
.Height = Printer.ScaleHeight
.BackColor = vbWhite
.Picture = Nothing
.Cls
.AutoRedraw = True
' Print RTB Content to picSource's hDC
' You may need more fancy RTB formatting code here
RichTextBox1.SelPrint .hdc 'THIS IS IT !
.Picture = .Image
.AutoRedraw = False
.Refresh
End With
'--------------------------------------
With picDest
' Resize picDest --->
.Width = Printer.ScaleWidth
.Height = Printer.ScaleHeight
.BackColor = vbWhite
'--------------------------------------
' Flip Vertically --->
.AutoRedraw = True
.PaintPicture picSource.Picture, picSource.ScaleWidth, 0, _
-picSource.ScaleWidth, picSource.ScaleHeight, _
0, 0, picSource.ScaleWidth, picSource.ScaleHeight, vbSrcCopy
picSource.Picture = .Image
.AutoRedraw = False
'--------------------------------------
' Flip Horizentally --->
.Cls
.AutoRedraw = True
.PaintPicture picSource.Picture, 0, picSource.ScaleHeight, _
picSource.ScaleWidth, -picSource.ScaleHeight, _
0, 0, picSource.ScaleWidth, picSource.ScaleHeight, vbSrcCopy
Set .Picture = .Image
.AutoRedraw = False
.Refresh
End With
'--------------------------------------
'Finally Print
Printer.PaintPicture picDest.Picture, 0, 0
Printer.EndDoc
End Sub
Hope it helps.
-
Nov 29th, 2005, 02:01 PM
#9
Thread Starter
New Member
Re: printing upside down
Thank you for your help.
I don't have VB on this computer but I will try iPrank's code this evening and let know tomorrow if it does what I need.
-
Nov 30th, 2005, 05:45 AM
#10
Thread Starter
New Member
Re: printing upside down
That code did solve my problem. It's exactly what I needed: wonderful rotation of 180 deg with the two combined flips. Thank you very much!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|