Documentation / Install guides

Install Flutter

A dart:ffi package with natives for five platforms.

1. Get the package

The download is public and needs no key — unlicensed output carries an evaluation watermark and nothing else is restricted. The package file is flutter.zip.

Download flutter

2. Check your platform

Two separate facts per platform: whether a licence key for this package covers it, and whether the download ships an engine binary for it.

Platform Licence covers it Binary in the download
win-x64 Yes Yes
linux-x64 Yes Yes
macos Yes Yes
ios Yes Yes
android Yes Yes

3. Install

yaml
dependencies:
  ffi: ^2.1.0
  lumaspdf:
    path: ./lumaspdf

4. Licence it

A licence is one key string, set once at startup. Buying one and installing it is covered by how licensing works; until then the engine runs fully functional with an evaluation watermark.

5. Your first PDF

The smallest complete program: create, write, close.

dart
import 'package:ffi/ffi.dart';
import 'package:lumaspdf/lumaspdf.dart';

void main() {
  final api = LumasPdfEngine.open();
  using((arena) {
    final pdf = api.pdfNewPDF();
    api.pdfCreateNewPDFA(pdf, 'hello.pdf'.toNativeUtf8(allocator: arena));
    api.pdfAppend(pdf);
    api.pdfSetFontA(pdf, 'Helvetica'.toNativeUtf8(allocator: arena), fsNone, 24.0, 1, TCodepage.cp1252);
    api.pdfWriteFTextA(pdf, taCenter, 'Hello from LumasPDF'.toNativeUtf8(allocator: arena));
    api.pdfEndPage(pdf);
    api.pdfCloseFile(pdf);
    api.pdfDeletePDF(pdf);
  });
}

Where next