View Source Api2pdf.LibreOffice (Api2pdf v0.1.2)

Convert documents from and to various formats using Libre Office backend.

Link to this section Summary

Functions

Generate an image of the first page of a PDF or Office Document.

Convert Office Document or Image to PDF format using LibreOffice.

Convert HTML to .docx format using LibreOffice.

Convert HTML to .xlsx using LibreOffice.

Convert a PDF file to HTML using LibreOffice. Limitation is that images will be lost.

Link to this section Functions

Link to this function

any_to_image(payload, options \\ [])

View Source
@spec any_to_image(
  Api2pdf.Model.LibreOfficeRequest.t(),
  keyword()
) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}

Generate an image of the first page of a PDF or Office Document.

The output will be a URL to a JPG file.

examples

Examples

Api2pdf.LibreOffice.any_to_image(%LibreOfficeRequest{url: "https://example.com/file.docx"})
Link to this function

any_to_pdf(payload, options \\ [])

View Source
@spec any_to_pdf(
  Api2pdf.Model.LibreOfficeRequest.t(),
  keyword()
) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}

Convert Office Document or Image to PDF format using LibreOffice.

examples

Examples

Api2pdf.LibreOffice.any_to_pdf(%LibreOfficeRequest{url: "https://example.com/file.docx"})
Link to this function

html_to_docx(payload, options \\ [])

View Source
@spec html_to_docx(
  Api2pdf.Model.LibreOfficeRequest.t(),
  keyword()
) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}

Convert HTML to .docx format using LibreOffice.

examples

Examples

Api2pdf.LibreOffice.html_to_docx(%LibreOfficeRequest{url: "https://example.com/page.html"})
Link to this function

html_to_xlsx(payload, options \\ [])

View Source
@spec html_to_xlsx(
  Api2pdf.Model.LibreOfficeRequest.t(),
  keyword()
) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}

Convert HTML to .xlsx using LibreOffice.

examples

Examples

Api2pdf.LibreOffice.html_to_xlsx(%LibreOfficeRequest{url: "https://example.com/page.html"})
Link to this function

pdf_to_html(payload, options \\ [])

View Source
@spec pdf_to_html(
  Api2pdf.Model.LibreOfficeRequest.t(),
  keyword()
) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}

Convert a PDF file to HTML using LibreOffice. Limitation is that images will be lost.

examples

Examples

Api2pdf.LibreOffice.pdf_to_html(%LibreOfficeRequest{url: "https://example.com/file.pdf"})