Your company's Logo

    Home Contact us Download Site map About us

 
i-Logic Products
Utilities
PDFActiveX

PDFActiveX Language Functions:

  • UTF8toCodePage(Text, CodePage) - Text is string in UTF-8 format, CodePage is string constant of one of the available language code pages. Returns a string that can be used to output text for a certain code page of the font.
  • UnicodeToCodePage(Text, CodePage) - Text is Wide String in Unicode format, CodePage is string constant of one of the available language code pages. Returns a string that can be used to output text for a certain code page of the font.
  • TextFromFile( Filename) - Returns a string with the contents of the file.
  • GetSystemEncoding - Returns a string containing the name of the language encoding the computer is set for.
 

The encodings for single-byte character set

The following character sets for single-byte character set are available.
 
Code Page Description
ISO8859-2 Latin Alphabet No.2
ISO8859-3 Latin Alphabet No.3
ISO8859-4 Latin Alphabet No.4
ISO8859-5 Latin Cyrillic Alphabet
ISO8859-6 Latin Arabic Alphabet
ISO8859-7 Latin Greek Alphabet
ISO8859-8 Latin Hebrew Alphabet
ISO8859-9 Latin Alphabet No. 5
ISO8859-10 Latin Alphabet No. 6
ISO8859-11 Thai, TIS 620-2569 character set
ISO8859-13 Latin Alphabet No. 7
ISO8859-14 Latin Alphabet No. 8
ISO8859-15 Latin Alphabet No. 9
ISO8859-16 Latin Alphabet No. 10
CP1250 Microsoft Windows Codepage 1250 (EE)
CP1251 Microsoft Windows Codepage 1251 (Cyrl)
CP1252 Microsoft Windows Codepage 1252 (ANSI)
CP1253 Microsoft Windows Codepage 1253 (Greek)
CP1254 Microsoft Windows Codepage 1254 (Turk)
CP1255 Microsoft Windows Codepage 1255 (Hebr)
CP1256 Microsoft Windows Codepage 1256 (Arab
CP1257 Microsoft Windows Codepage 1257 (BaltRim)
CP1258 Microsoft Windows Codepage 1258 (Viet)
KOI8-R Russian Net Character Set

The encodings for multi-byte character set

The following character sets for multi-byte character set are available.

 
Type of Encoding
 
Description
 
GB-EUC-H EUC-CN encoding
GB-EUC-V Vertical writing virsion of GB-EUC-H
GBK-EUC-H Microsoft Code Page 936 (lfCharSet 0x86) GBK encoding
GBK-EUC-V Vertical writing virsion of GBK-EUC-H
ETen-B5-H Microsoft Code Page 950 (lfCharSet 0x88) Big Five character set with ETen extensions
ETen-B5-V Vertical writing virsion of ETen-B5-H
90ms-RKSJ-H Microsoft Code Page 932, JIS X 0208 character
90ms-RKSJ-V Vertical writing virsion of 90ms-RKSJ-V
90msp-RKSJ-H Microsoft Code Page 932, JIS X 0208 character (proportional)
EUC-H JIS X 0208 character set, EUC-JP encoding
EUC-V Vertical writing virsion of EUC-H
KSC-EUC-H KS X 1001:1992 character set, EUC-KR encoding
KSC-EUC-V Vertical writing virsion of KSC-EUC-V
KSCms-UHC-H Microsoft Code Page 949 (lfCharSet 0x81), KS X 1001:1992 character set plus 8822 additional hangul, Unified Hangul Code (UHC) encoding (proportional)
KSCms-UHC-HW-H Microsoft Code Page 949 (lfCharSet 0x81), KS X 1001:1992 character set plus 8822 additional hangul, Unified Hangul Code (UHC) encoding (fixed width)
KSCms-UHC-HW-V Vertical writing virsion of KSCms-UHC-HW-H

 

 


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.

ver. 0.7.0  (1.8mb)
 

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

Other PDFActiveX functions

 

      
      
 

 
Copyright ©2010 i-Logic Software. email: support@i-logic.com
Last Modified 08/26/2007