Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

PHP wrapper over LibreOffice converter

License

NotificationsYou must be signed in to change notification settings

mnvx/lowrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Master Status:Build Status

PHP wrapper over LibreOffice converter

Simple way for documents conversion into various formats.

For example: html -> docx, html -> pdf, docx -> html and many more.

Formats

Usage

useMnvx\Lowrapper\Converter;useMnvx\Lowrapper\LowrapperParameters;useMnvx\Lowrapper\Format;// Create converter$converter =newConverter();// Describe parameters for converter$parameters = (newLowrapperParameters())// HTML document    ->setInputFile('test.html')// Format of result document is docx    ->setOutputFormat(Format::TEXT_DOCX)// Result file name    ->setOutputFile('path-to-result-docx.docx');// Run converter$converter->convert($parameters);

Moreexamples

Requirements

  • PHP 5.5+
  • libreoffice-core

Installation

sudo add-apt-repository ppa:libreoffice/ppasudo apt-get updatesudo apt-get install default-jdk -ysudo apt-get install python-software-properties  -ysudo apt-get install software-properties-common -ysudo apt-get install libreoffice-core --no-install-recommendssudo apt-get install libreoffice-writercomposer require mnvx/lowrapper

Example of installation libreoffice into docker container:

FROM php:7.2-fpmWORKDIR /var/www/html# Install libreoffice headlessRUN apt update -y \    && mkdir -p /usr/share/man/man1 \    && apt -y install default-jdk-headless libreoffice-core libreoffice-writer libreoffice-calcRUN mkdir -p /var/www/.cache/dconf \    && mkdir -p /var/www/.config/libreoffice \    && chmod -R ugo+rwx /var/www/.cache \    && chmod -R ugo+rwx /var/www/.config

Run tests

./vendor/bin/phpunit

License

Released under the MIT license


[8]ページ先頭

©2009-2025 Movatter.jp