Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Product Lifecycle
  3. Free Tools
  4. PrintDocument1_PrintPage vb.net

PrintDocument1_PrintPage vb.net

Scheduled Pinned Locked Moved Free Tools
csharpgraphics
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wanderleyolv
    wrote on last edited by
    #1

    olá a todos, eu criei um arquivo em .txt e gostaria de imprimir o documento atravez do componente PrintDocument1_PrintPage, só que os comandos estão dentro o arquivo .txt como segui o exemplo. Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim AlinhamentoLeft As New StringFormat() AlinhamentoLeft.Alignment = StringAlignment.Near Dim AlinhamentoRight As New StringFormat() AlinhamentoRight.Alignment = StringAlignment.Far Dim AlinhamentoCenter As New StringFormat AlinhamentoCenter.Alignment = StringAlignment.Center Dim xRowTop = 0 e.Graphics.DrawLine(New Pen(Brushes.Black, 0.6), 40, 50, 245, 50) e.Graphics.DrawLine(New Pen(Brushes.Black, 0.6), 40, 100, 800, 100) e.Graphics.DrawLine(New Pen(Brushes.Black, 0.6), 658, 40, 796, 40) e.Graphics.DrawRectangle(Pens.DarkGray, 658, 17, 139, 53) e.Graphics.DrawString("Codigo", New Font("Arial", 9.75, FontStyle.Bold), New SolidBrush(Color.Black), 37, 82) e.Graphics.DrawString("Nome", New Font("Arial", 9.75, FontStyle.Bold), New SolidBrush(Color.Black), 112, 82) e.Graphics.DrawString("Nome", New Font("Arial", 9.75, FontStyle.Bold), New SolidBrush(Color.Black), 482, 82) e.Graphics.DrawString("Ralatório de estoque", New Font("Arial", 14.25, FontStyle.Bold), New SolidBrush(Color.Black), 38, 25) e.Graphics.DrawString("Página", New Font("Arial", 9.75, FontStyle.Bold), New SolidBrush(Color.Black), 663, 47) e.Graphics.DrawString("Data:", New Font("Arial", 9.75, FontStyle.Bold), New SolidBrush(Color.Black), 663, 20) e.Graphics.DrawString("Fornecedor", New Font("Arial", 9.75, FontStyle.Bold), New SolidBrush(Color.Black), 397, 82) xRowTop = 106 NewPage = False If xRowTop > e.MarginBounds.Bottom + e.PageSettings.Margins.Bottom - 40 Then e.HasMorePages = True NewPage = True Exit Sub End If End Sub é como se fosse um arquivo do CrystalReports, só que usando o PrintDocument1_PrintPage e os comandos da Sub PrintDocument1_PrintPage estaria dentro do arquivo .txt. Se alguem puder ajudar agradeço. por wanderley

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups