GotenbergElixir.LibreOffice (Gotenberg Elixir v0.1.1)

Copy Markdown View Source

Provides functions to convert documents into PDF using Gotenberg's LibreOffice service.

Summary

Functions

Converts one or more LibreOffice document into a PDF file.

Types

compress_option()

@type compress_option() ::
  {:lossless_image_compression, boolean()}
  | {:quality, integer()}
  | {:reduce_image_resolution, boolean()}
  | {:max_image_resolution, integer()}

file()

@type file() :: {String.t(), binary()}

files()

@type files() :: [file()]

flatten_option()

@type flatten_option() :: {:flatten, boolean()}

merge_option()

@type merge_option() :: {:merge, boolean()}

metadata_option()

@type metadata_option() :: {:metadata, map()}

option()

page_property_option()

@type page_property_option() ::
  {:password, String.t()}
  | {:landscape, boolean()}
  | {:native_page_ranges, String.t()}
  | {:update_indexes, boolean()}
  | {:export_form_fields, boolean()}
  | {:allow_duplicate_field_names, boolean()}
  | {:export_bookmarks, boolean()}
  | {:export_bookmarks_to_pdf_destination, boolean()}
  | {:export_placeholders, boolean()}
  | {:export_notes, boolean()}
  | {:export_notes_pages, boolean()}
  | {:export_only_notes_pages, boolean()}
  | {:export__notes_in_margin, boolean()}
  | {:convert_ooo_target_to_pdf, boolean()}
  | {:export_links_relative_fsys, boolean()}
  | {:export_hidden_slides, boolean()}
  | {:skip_empty_pages, boolean()}
  | {:add_original_document_as_stream, boolean()}
  | {:single_page_sheets, boolean()}

pdfa_pdfua_option()

@type pdfa_pdfua_option() :: {:pdfa, String.t()} | {:pdfua, boolean()}

split_option()

@type split_option() ::
  {:split_mode, String.t()}
  | {:split_span, String.t()}
  | {:split_unify, boolean()}

Functions

convert(files, options \\ [])

@spec convert(files :: files(), options :: [option()]) ::
  {:ok, GotenbergElixir.HttpClient.Behaviour.response()}
  | {:error, GotenbergElixir.HttpClient.Behaviour.error()}

Converts one or more LibreOffice document into a PDF file.

## Parameters

  • files: A list of files as {filename, file}
  • options: Optional parameters passed as a keyword list.

## Options For a list of all available options, refer to the official Gotenberg documentation.