|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
PDFActiveX Language Functions:
The encodings for single-byte character set
The following character sets for single-byte character
set are available.
The encodings for multi-byte character set
The following character sets for multi-byte character
set are available.
Language use in Visual Basic Program This example program produces this
PDF output. The VB source files can be
downloaded here.
Option Explicit Private Sub Command1_Click() Const Align_Left = 0 Const Align_Right = 1 Dim ax As PDFActiveXLib Dim page Dim Font_Helvetica, Font_Russian, Font_Hebrew, Font_Arabic, Font_Greek Dim Russian_text, Hebrew_text, Arabic_Text, Greek_Text Dim fontname, s, widestring 'Create Document object and set properties Set ax = CreateObject("PDFActiveX.PDFActiveXLib") ax.NewDoc page = ax.AddPage ' Get font with certain code page Font_Helvetica = ax.GetFont("Helvetica", "") ' We will load a TrueType Font for the others Font_Greek = ax.LoadTrueTypeFont("C:\Windows\Fonts\arial.ttf", "CP1253", 1) ' You can only load the font once. 'If we want more encodings of the same font then use GetFont for each one ' The internal font name may be hard to find so we will use this function fontname = ax.GetFontName(Font_Greek) ' Using the same loaded font but with other code pages Font_Russian = ax.GetFont(fontname, "CP1251") Font_Arabic = ax.GetFont(fontname, "CP1256") Font_Hebrew = ax.GetFont(fontname, "CP1255") Russian_text = "Ñêîòëàíä-ßðä íå ó÷åë ñâåäåíèÿ, ïîëó÷åííûå ðîññèéñêèìè ñûùèêàìè â " & _ "õîäå ðàññëåäîâàíèÿ «äåëà Ëèòâèíåíêî». Îá ýòîì çàÿâèëè ïðåäñòàâèòåëè " & _ "àìè, ïî ìíåíèþ Ìîñêâû, íåäîñòàòî÷íî, ÷òîáû ïðåäúÿâèòü Àíäðåþ Ëóãîâîìó " & _ "îáâèíåíèå â óáèéñòâå." Hebrew_text = "ø÷èú ÷ñàí ôâòä ôâéòä éùéøä ááéú îâåøéí á÷éáåõ îöôåï ìøöåòú òæä, " & _ "úéðå÷ú áú 8 çåãùéí ùäééúä áîéèúä ðôâòä áàåøç ÷ì åôåðúä ì÷áìú èéôåì øôåàé, " & _ "àéîä ùì äúéðå÷ú îåâãøú ðôâòú çøãä. äæøåò äöáàéú ùì " & _ "äâ''éäàã äàéñìàîé, ''ôìåâåú àì-÷åãñ'', ðèìå àçøéåú ìéøé äø÷èä. ãåáø äàøâåï " & _ "îñø ëé îãåáø áø÷èä îñåâ '÷åãñ-3', ùðåøúä áîñâøú äîùê úâåáåú " & _ "äâ''éäàã äàéñìàîé ìîä ùäâãéø 'ôùòé éùøàì áâãä äîòøáéú åáøöåòú òæä'." Greek_Text = "Ï Õðïõñãüò ÅèíéêÞò ìõíáò ê. ÅõÜããåëïò ÌåúìáñÜêçò, óõíïäåõüìåíïò " & _ "áðü ôïõò Õöõðïõñãïýò ê. Âáóßëåéï Ìé÷áëïëéÜêï êáé ÉùÜííç Ëáìðñüðïõëï, " & _ "êáèþò êáé ôç ÓôñáôéùôéêÞ Çãåóßá, åðÝäùóå ôçí ÄåõôÝñá 16 " & _ "Éïõëßïõ áíáìíçóôéêü ìåôÜëëéï êáé ôéìçôéêü äßðëùìá óôïõò ìåôÜó÷ïíôåò " & _ "åõäïêßìùò óôéò åðé÷åéñÞóåéò Êýðñïõ, êáôÜ ôá ãåãïíüôá ðïõ Ýëáâáí ÷þñá óôçí " & _ "Ôçëõñßá êáé Ëåõêùóßá ôï 1964, óôçí Êïößíïõ - Áã. Èåïäþñïõò ôï 1967, " & _ "êáèþò êáé êáôÜ ôçí ÷ñïíéêÞ ðåñßïäï áðü 20-7-1974 Ýùò 20-8-1974...." Arabic_Text = "Ýí ßáãÊå Åáí ÇáÃãÉþ,þ ÈãäÇÓÈÉ ÇáÐßÑí ÇáÎÇãÓÉ æÇáÎãÓíä áËæÑÉ íæáíæ " & _ "ÇáãÌíÏÉþ,þ ÃßÏ ÇáÑÆíÓ ÍÓäí ãÈÇÑß Ãä Ããä ãÕÑ ÇáÞæãí ÓíÙá ÔÇÛáäÇ ÇáÔÇÛá " & _ "áãÕÑ æÔÚÈåÇ ÈÇÊÊ áÇÓÊßãÇá ÏíãÞÑÇØíÊäÇþ,þ æãæÇÕáÉ ÇáÅÕáÇÍ ÇáÇÞÊÕÇÏí " & _ "æÇáÇÌÊãÇÚíþ,þ æÏÝÚ ÌåæÏ ÇáÊäãíÉ Åáí ÇáÃãÇãþ." ' add text ax.AddTextArea page, "GREEK", 50, 30, 450, 100, 0, Font_Helvetica, 16, 0 ax.AddTextArea page, Greek_Text, 50, 50, 450, 200, 0, Font_Greek, 14, 0 ax.AddTextArea page, "RUSSIAN", 50, 210, 450, 100, 0, Font_Helvetica, 16, 0 ax.AddTextArea page, Russian_text, 50, 230, 450, 200, 0, Font_Russian, 14, 0 ax.AddTextArea page, "HEBREW", 50, 320, 450, 100, 0, Font_Helvetica, 16, 0 ax.AddTextArea page, Hebrew_text, 50, 340, 450, 200, Align_Right, Font_Hebrew, 14, 0 ax.AddTextArea page, "ARABIC", 50, 470, 450, 100, 0, Font_Helvetica, 16, 0 ax.AddTextArea page, Arabic_Text, 50, 490, 450, 200, Align_Right, Font_Arabic, 14, 0 ' Unicode and UTF-8 'Adobe PDF doesn't understand Unicode. We have to remap the Unicode to some code page. ' Unicode Text ax.AddText page, 50, 590, "Unicode" 'We can't type in Unicode into the editor, so we will load it from a file. widestring = ax.TextFromFile("Unicode.txt") s = ax.UnicodeToCodePage(widestring, "CP1253") ax.AddTextArea page, s, 50, 600, 450, 200, 0, Font_Greek, 14, 0 ' UTF-8 Text ax.AddText page, 50, 640, "UTF-8" s = ax.TextFromFile("UTF8.txt") s = ax.UTF8toCodePage(s, "CP1253") ax.AddTextArea page, s, 50, 650, 450, 200, 0, Font_Greek, 14, 0 ' Japanese text ' need a CID font with japanese characters Font_Japanese = ax.LoadFromTTC("c:\windows\fonts\msmincho.ttc", "90ms-RKSJ-H", 1, 1) Japanese_Text = ax.TextFromFile("sjis.txt") ax.AddText page, 50, 690, "Japanese" ax.AddTextArea page, Japanese_Text, 50, 700, 200, 50, 0, Font_Japanese, 14, 0 'Output the Document to a file ax.SaveToFile ("Ltest.pdf") ax.FreeDoc Set ax = Nothing End Sub %> Back to
main PDFActiveX page Download installation of PDFActiveX here: Fully functional, no limitations. Freeware.
Setup files and DLL have been digitally signed by i-Logic Software Example Delphi project
files here.
This software includes Haru
Free PDF Library 2.0.0 Copyright (c) 1999-2006 Takeshi Kanno |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
Copyright ©2010 i-Logic Software. email: support@i-logic.com
Last Modified 08/26/2007 |
![]() |