Hi buddies,
I am doing a project in vb6 for a restaurant. They are using continous paper roll of 5" width for billing. They need multi language printing. I tried it with Crystal report and even using printer.print command. As the bill is not having default size, i couldnt set a predefined paper size. When i give printer.enddoc the dotmatrix printer ejects enormous paper. I had searched many sites regarding this. Oops! no use.
Plese my buddies help me to make it succeed.
note: my competetor suceeded on this in various projects
16 9901
What type of printer is it?
Is it possible to find details of the codes that can be send to it?
I know that on my old-old-old printer (9 pins Star NL-10) it was possible to send control codes for the page length like = [ESC] "C" chr$(0) n .
Sets page length to n inches.
dear ggeu
its dotmatrix printer and you cant use escape sequence hence its printer.print command
thanks for try
I have found this in: http://www.bigresource.com I don't think you can use the PRINTER object.
Try opening the PRINTER as a file - with something like OPEN 'LPT1:' AS FILE...
Then do PRINT #1,CHR$(7)
I've never tried this on a PC with VB - but that is the way we talked to old-style printers on mainframes.
Dear ggeu
print # command wont support change of font
because its DOS style Printing
I tried it also.
Thank you again for follow-up
I tried with bigresource also nobody found a best solution for this.
Upto my knowledge, whomsoever going to tell the solution for this, will be the first person on net.
Do you know the ASCII code for "End of page" for your printer?
Once we know this, the only problem is the way how we must talk to the printer.
some say: ( http://www.xtremevbtalk.com) Well, the "best" way to do this, is to use s.c. Escape characters (defined in the printers manual) and send them to the printer directly. This means, if the printer is attached via LPT port, you send commands to it just like you would print to the plain text file. Something like this:
Code:
Open "LPT1" For Output As ...
Print #1, "Hello!"
Print #1, Chr$(10) 'line feed
Close #1
and if your printer is on COM port, You'd use MSCOMM component to output those same commands.
As I said, those commands are usualy listed in the printers manual.
Hi ggeu
I am extremely happy with your intention on my query.
But I like to inform you that I need different fonts of different columns. Your code I think, wont supports Windows fonts. Please keep in touch on this.
Are you using a form print ?
I have used this for a print in a game. - '§ Send a PRINTSCREEN-Window to the printer
-
Private Sub Com_print_Click()
-
'§1 Save Print Screen Window in Clipboard
-
On Error GoTo Print_Error
-
Clipboard.Clear
-
'§ call the Windows keybd_event sub, passing the built-in
-
'§ VB keyboard constant vbKeySnapshot (44) to the sub and 1& for the window catch.
-
keybd_event vbKeySnapshot, 1&, 0&, 0&
-
'§ pause to let Windows update the clipboard
-
DoEvents
-
'§2 retrieve the clipboard bitmap to the Picture
-
With Picture_print
-
.Picture = Clipboard.GetData(vbCFBitmap)
-
'§3 Wake up printer
-
Printer.Print
-
'§ print
-
Printer.PaintPicture .Picture, 1000, 1000
-
'§ close printer
-
Printer.EndDoc
-
End With
-
Exit Sub
-
Print_Error:
-
If Err.Number Then MsgBox Err.Description, vbOKOnly, "Printer Error!"
-
End Sub
it's also using Printer.Enddoc !!! but it sets the picture size.
You can change the form size depending on the lines to print !
Or is it the command "printer.enddoc " that is misunderstand by the printer.
If so, do you have the right printerdriver for Windows xx ?
any how i got a solution
With Win98 printer.print works well.
I donna know why its not with windows xp
Maybe the version of the printerdriver (not compatible with XP) ???
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Patrick Herb |
last post by:
Hello,
I'm trying to print the content of a RichTextBox from my VB 6 app.
What I want is that the CommonDialog shows up, the user selects a
printer and the content of the RichTextBox prints to the selected
printer. I'm not concerned about the text format.
What I tried is something like this
CommonDialog1.ShowPrinter
|
by: Lizard King |
last post by:
Hi.
I have a computer running a third party software (POS). The thing is
this application opens the printer port and I need to use another
program while the first one is still running.
Since the other app has the printer port windows shows an error
(path/file access error).
Is there a way that two applications can share the printer port?
|
by: Tom Berry |
last post by:
We currently are trying our first transformation from VB6 to VB.Net. Of
course, the Printer object is gone, but I'm having trouble finding the
replacement syntax necessary to perform similar actions or set variables.
We are interested in doing this inline (no pop-up dialog box).
Specifically, where how would I replace the following properties/methods of
the old Printer objects.
Printer.NewPage
Printer.TextHeight
Printer.TextWidth
|
by: Daniel Iwan |
last post by:
Hello everyone!
I have a problem with using TCanvas Printer and network printer HP
LaserJet
It print just first page and throws blank all the rest.
WinNT with Borland Builder 5.
All works fine with my HP 3820 with USB printer (WinXP)
|
by: Susan Beebe |
last post by:
I have downloaded the code described in Microsoft article Q154078. I
am trying to send raw ZPL (zebra barcode printer) code from Microsoft
access. It works just fine if I hard code the actual data in the
string being sent to the printer. However, if I prompt the user for
data or if I insert data from a particular record/field in a form
Access crashes/closes on its own.
I have included the code below, if anyone has any suggestions,...
| |
by: anilkumarkp |
last post by:
Hai
I have to print a receipt in pre-printer stationary with bar code, My paper size is 4", i have set the paers size as
Printer.ScaleMode = 1 ' vbTwips
Printer.Height = 4 * 1440
Printer.width = 8 * 1440
but after priting this, when i put Printer.EndDoc, it is skiping the all 12" paper, in this 12" i have to print 3 receipt (4x3). If i have not used the Printer.EndDoc it is not going to the spooler,
|
by: cjreynolds |
last post by:
Please excuse my cluelessness on the subject - this is the first time I've worked with printing in VB (and it may be the last) and the more I work with it, the more confused I become...
First, I'm setting the printer's scale and the X,Y position of the output:
Sub SetLargePrinterScale(obj As Object, VertPosition As Single)
Dim Owid As Single
Dim Ohgt As Single
Dim Pwid As Single
Dim Phgt As Single
Dim Xmid As Single
|
by: shanavaspi |
last post by:
Hi guys
am using printer object to print
Printer.print "Text"
Printer.enddoc
After the end doc the paper jumps to next page
Hoe i stop paper scrolling
Can any body Help me
|
by: Al Grant |
last post by:
I have a 'printable' button to generate printable output
and want this to use A3 if available, irrespective of the
user's default printer setting. Is there any way to set
a page's preferred printed paper size from HTML?
Portable if possible, but IE-only would be better than nothing.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |