Line Break

Line Break

Forum member · Apr 19, 2007
Hello, Quick question, how would I create a line break (<br />) to hold multiple lines in a label? Here is a sample of the code Imports Microsoft.VisualBasic Imports ceTe.DynamicPDF Imports ceTe.DynamicPDF.PageElements Imports System.Data Imports System.Data.SqlClient Partial Class TestPage Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) Handles MyBase.Load Dim MyDocument As ceTe.DynamicPDF.Document = New ceTe.DynamicPDF.Document MyDocument.Creator = "HelloWorld.aspx" MyDocument.Author = "Tony Chantharangsy" MyDocument.Title = "Test Page" Dim MyPage As ceTe.DynamicPDF.Page = New ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Portrait, 54.0F) <! ------------------ Dim Text As String = "test <br />test" <! ------------------ Dim MyLabel As Label = New Label(Text, 0, 0, 504, 100, Font.Helvetica, 18, TextAlign.Center) MyPage.Elements.Add(MyLabel) MyDocument.Pages.Add(MyPage) MyDocument.DrawToWeb("HelloWorld.pdf") End Sub End Class Thank you!

Re: Line Break

Support · Apr 20, 2007
Hello, Yes, you can write multi line labels without any problem. You will have to use the vbCrLf in the label's text when ever you want a new line. Following is a sample code to add a multi line label to the cell of a table. Dim doc As New Document Dim page As New Page Dim lable As New Label("ceTe " + vbCrLf + "Software" + vbCrLf + "Support", 10, 10, 100, 500) page.Elements.Add(lable) doc.Pages.Add(page) doc.DrawToWeb() Thanks, ceTe Software Support Team.