Cross-Platform LibHaru Nuget package

The forum is dedicated to powerful document creation library PDF.Flow.

Moderator: admin

Cross-Platform LibHaru Nuget package

Postby Nikolay.Gekht » Mon Dec 09, 2019 1:27 pm

This post is dedicated to libHaru build as Nuget package made by Gehtsoft and which is used as PDF creation layer in PDF.Flow library. However, if all you need is basic tools to create a simple PDF in your application, please do not hesitate to use free and open source libHaru instead.

The Nuget package can be downloaded here

https://www.nuget.org/packages/Haru.Net/1.0.9

.NETFramework 4.5.1 and .NETStandard 2.0 are supported.

We also have a version which is designed to run on Android and iOS which isn't published yet. However, if you are interested in one, please contact me to get a beta version.

What is libHaru

Libharu is a library that provides the set of basic operations to created PDF v 1.4. The primitives offered are: Add Page, Add text at exact position, Add image, Draw line and so on.

It provides everything you basically need to create a simple PDF document, however it operates rather like drawing in Graphics context than creating the document.

If you are interested in creating document that are automatically converts into PDF, consider Gehtsoft PDF.Flow library.

Who is Author of libHaru

The libHaru is an open-source library.

The main web site of the project is here http://libharu.org/

The source code is available at github https://github.com/libharu/libharu

If you experience any problem, please report it
https://github.com/gehtsoft-usa/PDFLib/issues

The source code of the exact version which is used to build the nuget package (it consists of few fixes made by Gehtsoft, which aren't yet incorporated into the main version of libharu) is available here: https://github.com/gehtsoft-usa/PDFLib
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

How to Use and Examples

Postby Nikolay.Gekht » Mon Dec 09, 2019 1:41 pm

Please refer to original libHaru documentation for details. The interface of the original libHaru remains intact in our build. The documentation is available here: https://github.com/libharu/libharu/wiki

To start using the libHaru

1) Add Haru.Net package to your project.

2) Initialize Haru, create a document and add the first page
Code: Select all
using HPdf;
...
            HPdfDoc pdf = new HPdfDoc();
            HPdfPage page = pdf.AddPage();


3) Add the information you need the page(s) (add more pages as needed)

Code: Select all
            page.BeginText();
            page.TextOut(60, page.GetHeight() - 80, "My Example");
            page.EndText();


4) Save PDF to file

Code: Select all
            pdf.SaveToFile("FontDemo.pdf");


Please find the source code of the samples of all basic functions of libHaru is attached to this post.

NOTE: If you want to run this application from command line, please do not forget to publish a portable version first and then run the published version rather than trying to run directly from the compilation output folder. The published puts all proper dependencies in place, so the application can be executed independently from Visual Studio.

The pre-compiled binaries may be downloaded here:
http://docs.gehtsoftusa.com/pdfflow/sam ... mo.bin.zip
Attachments
libharu.demo.src.zip
The source code of the demo application
(190.72 KiB) Downloaded 575 times
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC


Return to Gehtsoft PDF.Flow Library

Who is online

Users browsing this forum: No registered users and 4 guests