8000 Bindings · libharu/libharu Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Pete edited this page Sep 23, 2020 · 8 revisions

Table of Contents

Introduction

So far, libharu provides bindings for Ruby, Delphi/Free Pascal, Lua, C#(Microsoft .NET platform) and Swift.

If you wrote bindings for other programing languages, please let us know.

Ruby (1.8 or later)

On UNIX platform, exconf.rb is available. The installation process is as follows.

1. Build libharu. (See Documentation/Install chapter)

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

Delphi/Free Pascal

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

Free Basic

The source files for Free Basic bindings are in "if/freebasic" directory. See README.freebasic in the same dir on usage instructions.

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.

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 extract the binary package for win32 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.

PHP

PHP extension is available in PECL: http://pecl.php.net/haru
See PHP manual for instructions on how to install it.
Extension documentation is also available in the manual: http://php.net/haru

Perl

Perl bindings are available in CPAN: http://search.cpan.org/~butilw/PDF-Haru-1.00/lib/PDF/Haru.pm

JavaScript

hpdf.js is port of libharu to JavaScript: https://github.com/manuels/hpdf.js

Lua

LuaHPDF is a binding of libharu to Lua: http://luahpdf.colloquiki.com/

Swift

SwiftyHaru wraps libharu in a safe object-oriented manner, letting you use the full power of the Swift programming language to create PDF documents. https://github.com/WeirdMath/SwiftyHaru

Clone this wiki locally
0