Change Fontsize Programitically
How do I change the fontsize of a format programitically, any input would help..
BarTender.Application btApp;
BarTender.Format btFormat;
btApp = new BarTender.Application();
'Load format
btFormat = btApp.Formats.Open(@"c:\Templates\template.btw", false, "");
BarTender.DesignObject myTitle;
myTitle = btFormat.Objects.Find("Title");
'change the fontsize to 15
myTitle.FontSize = 15;
'save format
btFormat.SaveAs(@"c:\Output\"output.btw, true);
0
-
You need to make use of the DesignObject() that became available in v9.3 onwards:
// Declare a BarTender application variable BarTender.Application btApp; // Declare a BarTender document variable BarTender.Format btFormat; // Declare a BarTender design object variable BarTender.DesignObject btObject; // Create a new instance of BarTender btApp = new BarTender.Application(); // Set the BarTender application visible btApp.Visible = true; // Open a BarTender document btFormat = btApp.Formats.Open("c:\\Format1.btw", false, ""); // Set the object variable btObject = btFormat.Objects.Find("Text 1"); // Set the text size to 14pt btObject.FontSize = 14; // End the BarTender process btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);0
请先登录再写评论。
评论
1 条评论