/UE_LibHaru

UE5 runtime PDF writing plugin based on LibHaru.

Primary LanguageC++MIT LicenseMIT

UE_LibHaru

USED LIBRARY

LibHaru (We didn't use ZLIB, LIBJPEG or LIBPNG)
https://github.com/libharu/libharu

DEPENDENCIES

https://github.com/FF-Projects-UE/ExtendedVars

TARGET PLATFORM

  • It currently only works on Windows platform.

LIBHARU WRITE FUNCTIONS

  • LibHaru - Create Document: It creates a LibHaru based PDF file. It's object is different than PDFium's. So, you can't merge them unless export it and then re-import it, first.

  • LibHaru - Add Pages: It adds pages to target PDF file with defined size. (Array count is page count and each vector element of array is its size)

  • LibHaru - Load Standart Font: There are 14 standart fonts embedded to PDF libraries according to PDF Spec 1.7 page 416. This function allows to select one them.

  • LibHaru - Load External Font:

  • LibHaru - Add Text: It adds text objects to target page. Libharu doesn't support line break at default but we integrated a parse system. So it has auto wrap feature. Neverthless, we suggest you that be careful about your layout (for example when will you create a line break or not)

    • Text Color
    • Position X = Horizontal position.
    • Position Y = Vertical position but it starts from bottom. If your PDF page's height is 800 pixel, top will be 800 and bottom will be 0.
    • Shear X and Y = It strecth your text object. Scaling won't be vectoral. So we don't suggest it.
    • Rotation X and Y = We don't know how it works right now.
    • Border X and Y = It defines vertical and horizontal borders.
  • LibHaru - Add Image: It adds an UTexture2D to target page. Extension and format is not important. Function converts its data to RGB Raw Data.

  • LibHaru - Add Line, Circle, Ellipse, Arc and Rectangle: It draws line, circle, ellipse, arc or rectangle to target page with specified properties.

  • LibHaru - Add U3D 3D Model to PDF: It adds a U3D 3D model to target page. You can define background color, viewer size and location. You can convert your models to U3D with Aspose OBJ/GLTF/FBX online converter to U3D or you can use local tools like CAD Exchanger. U3D extension is very primitive. So, don't expect realistic views. Google Chrome and other basic PDF viewers can't show 3D contents on PDF pages. You have to use Acrobat Pro like professional tools to view it.

  • LibHaru - Save PDF: It saves PDF file to given absolute path. You don't need to spawn anything to use this function like PDFium.

  • LibHaru - Save as Bytes: It saves PDF as bytes array (TArray). So, you can render it with PDFium without writing and reading a PDF file.

  • LibHaru - Close Document

ROADMAP

  • Mobile Support