Make use of .NET SDK to change page and label dimensions Follow

Avatar
Alessandro De Vittorio

Overview

This article will show how to make use of .NET SDK to change paper height and width of your BarTender document. 

Applicable to

BarTender Automation Edition and above

Information

The btFormat.PageSetup.PaperHeight and btFormat.PageSetup.PaperWidth properties allow you to set or return the height and width of the paper stock in the units that are specified. The below sample will demonstrate how you can set/change the height and width using VB .NET.

 


Imports Seagull.BarTender.Print

Public Class Form1

Imports Seagull.BarTender.Print

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Using btEngine As New Engine()
            btEngine.Start()
Dim btFormat As LabelFormatDocument = btEngine.Documents.Open("C:\Labels\Mytest.btw")
Dim btPageSetup As PageSetup = btFormat.PageSetup
            btFormat.PageSetup.Units = Units.Millimeters
            btFormat.PageSetup.LabelHeight = 90
             btFormat.PageSetup.PaperHeight = 90
           btFormat.Close(SaveOptions.SaveChanges)
            btEngine.Stop()

End Using
End Sub
End Class

Additional resources

  • For more specific information on making use of .NET SDKs from BarTender, start your BarTender copy, open the "Help > BarTender Help" Menu and visit the "Automating BarTender > Automation with the BarTender .NET SDK" section.
  • For more general information on automating BarTender, please refer to BarTender Help.

Please sign in to leave a comment.