napadla ma este jedna vec. v pripade ak mas na obrazovke to co na fakture, alebo si zobrazis form ktory bude presne ako faktura, je mozne spravit jednoduchu vec: hardcopy obrazovky do bitmapy a tu potom vytlacit. netusim aka bude kvalita, a ci to vobec pojde, nemam tu printer na notasku, ale skus, mozno Ta to inspiruje a len domodifikujes
'' importy na zaciatok
Imports System.Drawing.Printing
Imports System.Drawing.Printing.PrintDocument
''toto do nejakej vhodnej procedury
Dim screenSize As Size = New Size(Me.Width, Me.Height)
''velkost Tvojho formu sa prevezme
Dim screenGrab As New Bitmap(Me.Width, Me.Height)
'' vytvori sa nova bitmapa
Dim myGraphic As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)
myGraphic.CopyFromScreen(New Point(Me.Left, Me.Top), New Point(0, 0), screenSize)
''teraz screenGrab nesie v sebe bitmapu hardocopy formulara
screenGrab.Save("C:\faktura.bmp")
''najjednoduchsie ma napadlo savnut to, aj tak imho faktury vytlacene zalohujete, mozes pridat timestamp do nazvu atd...
Dim PrintDoc As New PrintDocument
PrintDoc.DocumentName = ("C:\faktura.bmp")
PrintDoc.Print()
neviem ci to zacne hned tlacit, ako vravim nemam tu printer ale tvari sa mi to ze tlaci to fronty, ak to vytlaci male alebo posunute, musis nastavit properties PritDocumentu (velkosti, rozmery, mierky a pod, to najdes v helpe)
|