Posted 10 January 2018, 4:35 pm EST
Ok I was able to alter my code on my Label using your example, thank you.
Working with my second label I am using a Vertical bar code and I’ve tried a number of things to try to fix it but no luck.
The code below is the code you sent me with a few modifications My end goal is to have the vertical bar code be about .25" tall and have it extend 1.8" (vertically) on the 2x4" label.
The vertical is what I am interested in the horizontal is for reference.
Imports C1.C1Preview
Imports C1.C1Report
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim text As New RenderText(“C1PrintDocument Test”)
text.Style.TextAlignHorz = AlignHorzEnum.Left
text.Style.FontSize = 12
text.Style.FontBold = True
C1PrintDocument1.Body.Children.Add(text)
'Label Size
With C1PrintDocument1.PageLayout.PageSettings
.TopMargin = 0.1
.BottomMargin = 0.1
.LeftMargin = 0.1
.RightMargin = 0.1
.PaperKind = Drawing.Printing.PaperKind.Custom
.Height = 4
.Width = 2
.Landscape = True
End With
'Vertical Label *************************************************************************************
Dim c As New C1.Win.BarCode.C1BarCode
c.CodeType = C1.BarCode.CodeType.Ansi39x
c.Text = 9999999
c.BarDirection = C1.BarCode.BarCodeDirection.BottomToTop 'changed ***********************************
Dim bc As New RenderImage
bc.X = 3.6
bc.Y = 0.1
bc.Width = ".25in"
bc.Height = "1.8in"
bc.Image = c.Image
C1PrintDocument1.Body.Children.Add(bc)
'Horizontal Label *************************************************************************************
Dim c2 As New C1.Win.BarCode.C1BarCode
c2.CodeType = C1.BarCode.CodeType.Ansi39x
c2.Text = 9999999
Dim bc2 As New RenderImage
bc2.X = 0.1
bc2.Y = 1
bc2.Width = "1.8in"
bc2.Height = ".25in"
bc2.Image = c2.Image
C1PrintDocument1.Body.Children.Add(bc2)
'Dim barcode As New RenderBarCode(BarCodeEnum.Ansi39)
'barcode.X = 1.5
'barcode.Y = 2.5
'barcode.Height = "0.5in"
'barcode.Width = "1.75in"
'C1PrintDocument1.Body.Children.Add(barcode)
C1PrintPreviewControl1.Document = C1PrintDocument1
End Sub
End Class