Howto Format A Part Of Text With Bold And Underlined With Source From Access Table
Hi,
I'm a Newbe BarTender with a test version.
Is it possible to format a part of a text field based on a lookup table in MS Access (mdb)?
I have a table with a text field like : one, two, three, four , five.
and a second table with records like : two and five
before printing I want to format the textfield like : one, two, three, four , five.
Thanks in advance,
Jan.
-
Are you perhaps after the new ingredients regulation from beginning December 2014 (EU Regulation N°1169/2011 (Food Information to Consumers, or FIC)?
If yes, we can send you some sample which makes use of the markup language container objects in BarTender.
0 -
Legacy Poster
★ BarTender Hero ★
Yes Domingo, that is it. ;)
I would really appreciate it if you send me some samples.
0 -
BarTender is indeed prepared for this new ingredients label regulation (EU N° 1169/2011, Food Information to Consumers allergen labelling) and we've some samples for you to examine.
1.- The first example (Ingredients.txt and Samplev2.btw") makes use of markup language objects, such as RTF or HTML, which will allow you to then use markup languages inside the database in order to format the data in bold, cursive…
** Please note that although a database engine supports you to format a certain text as bold, cursive, the OLE DB provider, when supplying this data to the program which wishes to connect to the database, will not import the font styles. The text will be imported as plain text. This is why you will need to format the data using markup languages.
In BarTender, we’ve a “Mark-up Language Container” feature which would allow you to use mark-up languages (such as RTF, HTML and XAML) inside your database:
Be aware that these containers can only be used with Windows fonts, not with printer internal fonts (basically because the printer language won’t know how to encode this information).
Please take a look at the "Ingredients.txt" file. As you will see, the items to be marked in bold have a <b> and </b> tab around them. This is because the database is using HTML tags (in this case, but it could also be XAML or RTF). This will indicate BarTender, when making use of the HTML container, that the text followed by <b> will be in bold.
Now open the BarTender document and double click the text object to open its properties. You will see 3 data sources:
• The first one is the HTML header. You can define things here such as which font style to use.
• The second one directly reads from the database field. As soon as it encounters some text surrounded by <b> and </b>, this part of the text will be put in bold.
• The last data source will close the HTML tags and therefore ending the HTML construction.You will need the Professional Edition of BarTender (or higher) in order to work with this sample. Modification of the ingredients database is required, as you will need to format the database with markup language tags.
2.- There is a different approach which makes use of VBScript and of a list of allergens to be put in bold. This example will allow you to make no modifications to the database, but instead create a list of allergens and those will be put in bold / cursive / bold-cursive.
You can download the sample from the below link:
https://drive.google.com/file/d/0B33fAd6W79x8TmxrQ2NKNjA0NGs/edit?usp=sharingWhen you open the BarTender document you will see nothing but a single paragraph text object. It is a list of ingredients (sourced from an Access database), nothing more. Just one data source.
Click the "Print Preview" button. You will now see that, the words "Wheat", "Rye" and "Milk" have become bold.
There are two "Data Sources" within BarTender which make this possible:
• "Allergens", which is a list of allergens (this is being read from an external text database).
• "AllergenStyle", which can be set to Bold, Italic or Bold-Italic. This will be applied to the allergen at print time.How is the sample able to transform the allergens into "bold" or "italic"? Because the BarTender document makes use of 2 layers, one of them is hidden by default. You can check this by going to the "Layers" tab of BarTender's Toolbox.
• The "Label Design" layer will contain:
o A text object which has to be named "Ingredients Text" with a data source named "Ingredients" (if you change this, then make sure to adapt the VBScript code as well).
o This object is only used at design time. At print time, its print condition is set to never.• The "Print-Time HTML" layer contains a single HTML markup language container on it:
o The layer is hidden by default.
o The HTML object is set so that the font style (bold, italic, bold-italic) comes from the "BodyStyle" variable.
o This HTML container mostly uses VBScript. The purpose of the VBScript is to look at the "Ingredients" variable, and then transform it with markup tags once an allergen is found.You will also find a BarTender document VBScript (via the "File > BarTender Document Options" Menu and now the "VBScripting" tab, which does the following:
• Looks at the font name, size, and color of the “Ingredients Text” object, and applies those attributes to the HTML.
• Looks at the position and width of the “Ingredients Text” object, and applies those attributes to the “Ingredients HTML” object.
• These two changes combined allow you to effectively set the size, position, font, and color of the HTML, by modifying only the text object.The Automation Edition of BarTender (at least) is required to run this other sample.
1 -
Legacy Poster
★ BarTender Hero ★
Hello, would I be able to use this functionality (2nd approach), to achieve the following method to have larger font size for some of the digits in 1 field.
We have an item code existing of 16 characters (letters and digits) where all leasing zero's should be same size as the letters, but the other digits should be a larger fontsize
for example
ABCD00023ABC0011
ABCD00123ABC0010
I just tried to open the btw file and it tells me that it cant open with our version.
Our version is shown below: will we be able to do anything similar to the request with this?
BarTender
World-famous software for designing and printing labels, bar codes and RFID tags.Edition: Enterprise (125 Printers)Version: 9.2 SR2Build: 2674Activation Status: Activated0 -
Lino Soares
★ BarTender Hero ★
Good Evening.
I have a table with a text field like : one, two, three, four , five.
before printing I want to format the textfield like : one, two, three, four , five.
How can I do this with the free edition?
0
請登入寫評論。
評論
5 條評論