Você está na página 1de 13

Uploading External Fonts

XML Publisher enables you to use fonts in your output that are not normally available on the server. To set up a new font for your report output, use the font to design your template on your client machine, then make it available on the server, and configure XML Publisher to access the font at runtime. 1. Use the font in your template. i. Copy the font to your <WINDOWS_HOME>/fonts directory.

IDAutom ationSHI25 M.ttf

ii. iii.

Open Microsoft Word and build your template. Insert the font in your template: Select the text or form field and then select the desired font from the font dialog box (Format > Font) or font drop down list.

2.

Place the font on the server.

Direct Uploading the Font to the server directory


Place the font in a directory accessible to the formatting engine at runtime.

Installing the Font using XML Publisher Administrator


XML Publisher 5.6.0 and later versions provides a feasibility of installing the fonts through the Administration Tab instead of porting the font file directly to the server. The Administration tab in XML Publisher Responsibility is used in replacement of xdo.cfg configuration file. Now fonts can be uploaded and stored in the database instead on the file system. Follow below steps to install a font: 1. Log in as XML Publisher Administrator. 2. Navigate to Administration Font Files Create Font File.

Font Name: Choose any descriptive name. Ex: IDAutomationSHI25M File: Browse the appropriate font file. Upload the .ttf file you want to upload. 3. Navigate to Font Mappings Create Font Mapping Set.

Mapping Name: The name given to a set of fonts. Ex: IDAutomationSHI25M Mapping Code: The internal name you will give to this set. Ex: IDAutomationSHI25M Type: 'PDF Form' for PDF templates. 'FO to PDF' for all other template types. Click Apply 4. Create Font Mapping (this allows you to add fonts to a set).

Once Create Font Mapping is clicked, below screen appears.

Font Family is the exact same name you see in Word under Fonts. (Note: If you don't use the same name the font will not be picked up at runtime.) Style and Weight must also match how you use the font in windows. Normal and Normal are defaults. Font Type is to be selected as Truetype After providing all the above details, click on Continue tab

Once Apply button is selected, below screen appears.

5. Navigate to Configuration General FO Processing Font Mapping Set. This can also be done at Data Definition and Template level under Edit Configuration. Hierarchy is Site Data Definition Template.

Select your new mapping set. 6. Make sure the font is not referenced under File Properties Custom in the RTF template file. 7. Under General set a Temporary Directory. The font will be downloaded here under /tmp/fonts to be used at runtime (the first time the font is used). 8. Upload a template that uses your special font and test using preview or by submitting a concurrent request.

TEST EMPLOYEE PROGRAM:


Ex: Test Employee Program: 1. Create a RDF and RTF template with sample employee data.

TEST_DEPT_EMP.rdf

DEPT_EMP.rtf

2. Select

Department

number

field

and

make

its

font

type

as

IDAutomationSHI25M

3. Create Concurrent program, data definition and Template with the above RDF and RTF.

Program Name: TEST_DEPT_EMP

Data Definition Name: TEST_DEPT_EMP

Template Name: TEST_DEPT_EMP

4. Now Query the Data definition: Data Definition Code: TEST_DEPT_EMP

Click the Preview Data > Add file Button as below,

Click Browse and select the sample XML source.

5. Now Query the template,

Template Code: TEST_DEPT_EMP

Click the Preview button as below,

Click Open,

Output:

To Test in Local Machine


Bar Code Printing
1. 2. Copy the Font IDAutomationSHI25M.ttf to the <WINDOWS_HOME>/Fonts directory. Open the RTF Template layout and select the Text or Form field for which the font to be applied and select the Font as IDAutomationSHI25M from the dropdown (Format > Font) RTF:

3.

Now navigate to File > Properties > Custom Tab Add a custom font: Name: xdo-font.IDAutomationSHI25M.normal.normal Type: Text Value: truetype.C:\WINDOWS\Fonts\IDAutomationSHI25M.ttf

4.

Load the XML data and Preview the output in Local machine. Output:

Você também pode gostar