Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / August 2006

Tip: Looking for answers? Try searching our database.

Print ID card using Plastic Card Printer in VB.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raman - 29 Jul 2006 11:07 GMT
Hello friends,

I want to print an ID card. I have one Windows Form that contains front

and back side. The printer is printing both front and back side at a
time. I am trying to send both sides at a time. But it is printing
front side on one card and back side on second card. I want to print
both sides in a same card.

Thanks in advance.

Regards,

Raman.
HKSHK - 29 Jul 2006 11:49 GMT
Hello Raman,

Perhaps you should contact the manufacturer of that printer.

Best Regards,

HKSHK

> Hello friends,
>
[quoted text clipped - 10 lines]
>
> Raman.
Smokey Grindle - 29 Jul 2006 18:10 GMT
We would need way more info then that about it... whats the printer mfg?
model? have you contacted them about it?

> Hello friends,
>
[quoted text clipped - 10 lines]
>
> Raman.
Raman - 31 Jul 2006 07:25 GMT
Yes, i have contacted about it.

Manufacture : Dualys
Printer specification : Module for dual sided printing
                               Integrated ribbon saver for monochrome
printing
printer speed : 150 cards/hour
resolution : 300 dpi

It is operated as printing both sides at a time. It takes automatically
when u send 2 pages for printing. I have send a word document with 2
pages. It takes first page as a front end and second page as back end.
What is my problem is i have designed a windows form. It contains 2
frames one is for front side another for back. I want to send both
frames at a time to printer when a button is clicked

> We would need way more info then that about it... whats the printer mfg?
> model? have you contacted them about it?
[quoted text clipped - 13 lines]
> >
> > Raman.
HKSHK - 31 Jul 2006 07:52 GMT
Hello Raman,

>>> I want to print an ID card. I have one Windows Form that contains front
>>>
>>> and back side. The printer is printing both front and back side at a
>>> time. I am trying to send both sides at a time. But it is printing
>>> front side on one card and back side on second card. I want to print
>>> both sides in a same card.

Did you send both sides with one print job? I would expect that if you
send both sides separately that it takes it as 2 cards.

Best Regards,

HKSHK

> Yes, i have contacted about it.
>
[quoted text clipped - 29 lines]
>>>
>>> Raman.
Raman - 01 Aug 2006 06:47 GMT
Hello HKSHK,

Please help me out from this problem

I have 2 frames in windows form. From that i have created 2 bitmap
images.
When i call use this function only back side is printed and card is
strucked in the printer. But two pages are send to printer. but second
image is overwritted on frirst image. So second page does not contain
any thing.

Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e
As Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage
       e.Graphics.DrawImage(Me.Print_ImageF, 0, 0)
       e.HasMorePages=True
       e.Graphics.DrawImage(Me.Print_ImageB, 0, 0)
   End Sub

or

When i use this function both front side and back side is printed. but
both are printed in different card.
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPrint.Click

page=1         ' Vriable to represent which page
   For i = 1 To 2
               PrintDocument1.Print()         'Print the document
               page = page + 1
   Next
End Sub

 Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e
As Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

       If page = 1 Then
           e.Graphics.DrawImage(Me.Print_ImageF, 0, 0)
       ElseIf page = 2 Then
           e.Graphics.DrawImage(Me.Print_ImageB, 0, 0)
       End If

  End Sub

I have created these two images by following coding in btnPrint_Click
function. It is created before the print command is called.

  'We make the form look pritty befor its picture
           Application.DoEvents()
           Me.Refresh()
           Application.DoEvents()
           'Get a Graphics Object from the form
           Dim FormGF As Graphics = gbFront.CreateGraphics
           'Create a bitmap from that graphics
           Dim iFront As New Bitmap(gbFront.Width, gbFront.Height,
FormGF)
           'Create a Graphics object in memory from that bitmap
           Dim memGFront As Graphics = Graphics.FromImage(iFront)

           'get the IntPtr's of the graphics
           Dim HDC1 As IntPtr = FormGF.GetHdc
           Dim HDC2 As IntPtr = memGFront.GetHdc
           'get the picture
           BitBlt(HDC2, 0, 0, gbFront.ClientRectangle.Width,
gbFront.ClientRectangle.Height, HDC1, 0, 0, 13369376)
           'Clone the bitmap so we can dispose this one
           Me.Print_ImageF = iFront.Clone()
           'Clean Up
           FormGF.ReleaseHdc(HDC1)
           memGFront.ReleaseHdc(HDC2)
           FormGF.Dispose()
           memGFront.Dispose()
           iFront.Dispose()

           Dim FormGB As Graphics = gbBack.CreateGraphics
           Dim iBack As New Bitmap(gbBack.Width, gbBack.Height,
FormGB)
           Dim memGBack As Graphics = Graphics.FromImage(iBack)

           Dim HDC3 As IntPtr = FormGB.GetHdc
           Dim HDC4 As IntPtr = memGBack.GetHdc
           'get the picture
           BitBlt(HDC4, 0, 0, gbBack.ClientRectangle.Width,
gbBack.ClientRectangle.Height, HDC3, 0, 0, 13369376)
           'Clone the bitmap so we can dispose this one
           Me.Print_ImageB = iBack.Clone()
           'Clean Up
           FormGB.ReleaseHdc(HDC3)
           memGBack.ReleaseHdc(HDC4)
           FormGB.Dispose()
           memGBack.Dispose()
           iBack.Dispose()

> Hello Raman,
>
[quoted text clipped - 45 lines]
> >>>
> >>> Raman.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.