Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

FF-Plugins-Archive/FF_LibHaru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE

We frequently check our issues. If you have a problem, open an issue. Not send us an email. If problem is about us and we can help you, we will help you. Sending an email won't change our response speed.

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 AND ENGINE

  • It only works on Windows platform (both development and build)
  • It supports current launcher version of engine.
    • We update engine version after one month of new release.
    • For example current version is 5.3 but it is not 1 month old. So, we support 5.2. But after that, we will support only 5.3. This will be same for all future versions.
    • Don't ask us about older engine versions.

USAGE

  • Open a C++ project with correct engine version.
  • Generate Visual Studio Project Files
  • Press F5 in Visual Studio to build plugin and open your project.
  • There is a sample blueprints in plugin's content folder.

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. These fonts don't support extended characters (Turkish, Cyrillic and Asian). If you want to use that kind of chars, you have to find and use external fonts.

  • 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

IMPORTANT FOR IMAGE INSERT

In order to insert images to PDF files in runtime, you have to do these changes for your textures. Because currently DXT textures aren't supported in runtime. But you can use them for editor-only projects.
Runtime imported textures are generally transient PF_B8G8R8A8 without compression. They can work without problem.

  • Texture Group as UI
  • MipGen Settings as NoMipMaps
  • CompressionSettings as UserInterface2D