home | download | documentation | examples | sourceforge | forums

## Bindings for other programing languages

### Introduction

So far, libharu provides bindings for Ruby, Delphi/Free Pascal and C#(Microsoft .NET platform).
If you wrote bindings for other programing languages, please notice me.

### Ruby (1.8 or later)

On UNIX platform, exconf.rb is available. The installation process is as follows.
1. Build libharu as a static library. (See the chapter of "Install")
NOTE:
In linux platform, adding -fPIC option on cflags is recommended for the performance improvement.
2. Change directory to "libharu-X.X.X/if/ruby" and run extconf.rb.
ruby extconf.rb
3. Then invoke "make install" command.
make install
If you want to use "Ruby binding for Haru" on windows platforms, download binary package (libharu_x_x_x_ruby_win32.zip) and copy hpdf.so to "site_ruby/X.X/i386-msvcrt" directory manually. (This package is for ruby1.8 built by MSVC)
exconf_msvc.rb is also available. but it is not tested well.

### Delphi/Free Pascal

The interface files for Delhp/Free Pascal are in "if/delphi" directory.
To use this interface, build Haru as a shared-library (DLL) or use binary package for win32(libharu_x_x_x_dll_win32.zip).

### C#

The interface files for C# are in "if/c#" directory.
To use this interface, build Haru as a shared-library (DLL) or use binary package for win32(libharu_x_x_x_dll_win32.zip).
There are some example programs in demo directory. The steps to run the demonstration programs is as follows.
1. Build libharu as a shared library and copy libhpdf.dll to "if\c#\demo" directory.
(Or expand binary package for win32(libharu_x_x_x_dll_win32.zip) and copy libhpdf.dll to "if\c#\demo" directory.)
2. Compile and run demo programs. (Don't forget to compile hpdf.cs together.)
csc /out:FontDemo.exe FontDemo.cs ..\hpdf.cs
FontDemo.exe
csc /out:ImageDemo.exe ImageDemo.cs ..\hpdf.cs
ImageDemo.exe
csc /out:JPFontDemo.exe JPFontDemo.cs ..\hpdf.cs
JPFontDemo.exe
csc /out:LineDemo.exe LineDemo.cs ..\hpdf.cs
LineDemo.exe
csc /out:OutlineDemo.exe OutlineDemo.cs ..\hpdf.cs
OutlineDemo.exe
csc /out:Encryption.exe Encryption.cs ..\hpdf.cs
Encryption.exe
csc /out:Permission.exe Permission.cs ..\hpdf.cs
Permission.exe
csc /out:RawImageDemo.exe RawImageDemo.cs ..\hpdf.cs
RawImageDemo.exe
csc /out:TextDemo.exe TextDemo.cs ..\hpdf.cs
TextDemo.exe
Because I do not know the Visual studio well, I do not explain usage on Visual Studio here.
NOTE:
libhpdf.dll is required to run the program which uses C# interface for libharu.
I tested this interface only in Microsoft .NET Framework SDK 1.1.