New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

blaspsoft/doxswap

Doxswap is a simple document conversion package for Laravel which uses LibreOffice to convert documents to a variety of formats.
35,361 237

Larablocks Analysis

blaspsoft/doxswap works with Laravel 8 to 13 (latest release v2.0.0, Nov 3, 2026).

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 3 of 4 checks; below the bar for Recommended on use.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Nov 3, 2026)
  • 4,353 downloads a month (needs 10,000)
  • 237 GitHub stars (at least 100)

State

Actively maintained
  • Last stable release: Nov 3, 2026.
  • 3 releases in the last 12 months.
  • First released: Mar 5, 2025.
  • Monthly downloads: 4,353.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 30, 2026.

Install
composer require blaspsoft/doxswap
Latest Version:v2.0.0
PHP:^8.2
Laravel:8 – 13
License:MIT
Last Updated:Nov 3, 2026
Links: GitHub  ·  Packagist
Maintainer: Deemonic

Onym Icon

GitHub Workflow Status (main) Total Downloads Latest Version License

Doxswap

A Laravel package for seamless document and image format conversions. Transform between various formats like DOCX -> PDF, HTML -> PDF, PNG -> WEBP, and more popular formats using a simple, elegant API. Powered by LibreOffice for documents and ImageMagick for image processing.

🚀 Features

  • 📄 Multiple Format Support – Convert between documents (DOCX, XLSX, ODT) and images (PNG, JPG, WEBP) with ease
  • 🚀 Simple API – Easy-to-use interface for all conversion operations
  • 💾 Laravel Storage Integration – Works seamlessly with Laravel's filesystem drivers
  • ⚡ Efficient Processing – Optimized conversion using LibreOffice and ImageMagick engines
  • 🔍 Conversion Tracking – Detailed results including duration and file paths
  • 🔒 Secure File Handling – Safe and secure file processing with proper cleanup
  • ⚙️ Configurable Settings – Customize paths, storage disks, and conversion options
  • 🛡️ Error Handling – Robust exception handling for unsupported formats and conversions

Installation

You can install the package via composer:

composer require blaspsoft/doxswap

You can publish the config file with:

php artisan vendor:publish --tag="doxswap-config"

Overview

The config/doxswap.php file includes:

💾 Storage & Cleanup
  • input_disk: Where to read files from (default: 'public')
  • output_disk: Where to save converted files (default: 'public')
  • perform_cleanup: Delete input files after conversion (default: false)
📝 File Naming

Configure how output files are named using different strategies:

'filename' => [
    // Strategy: 'original', 'random', or 'timestamp'
    'strategy' => 'original',

    // Naming options
    'options' => [
        'length' => 24,          // Length for random names
        'prefix' => '',          // Add prefix to filename
        'suffix' => '',          // Add suffix to filename
        'separator' => '_',      // Separator for components
        'format' => 'YmdHis',    // Format for timestamp strategy
    ],
]
🛠️ Conversion Drivers

Configure paths for conversion tools:

'drivers' => [
    'libreoffice_path' => env('LIBREOFFICE_PATH', env('LIBRE_OFFICE_PATH', '/usr/bin/soffice')),
    'process_timeout' => env('DOXSWAP_PROCESS_TIMEOUT', 120), // seconds, or null for no limit
]

Default LibreOffice paths by OS:

  • 🐧 Linux: /usr/bin/soffice
  • 🍎 macOS: /Applications/LibreOffice.app/Contents/MacOS/soffice
  • 🪟 Windows: C:\Program Files\LibreOffice\program\soffice.exe
📄 File Types

Supports various document formats including:

  • Documents: DOC, DOCX, ODT, RTF, TXT
  • Spreadsheets: XLS, XLSX, ODS, CSV
  • Presentations: PPT, PPTX, ODP
  • Images: JPG, PNG, SVG, BMP, TIFF, WEBP, GIF
  • Web: HTML, XML
  • Other: PDF

Usage

$result = Doxswap::convert('sample.docx', 'pdf');

/**
 * Returns a ConversionResult object with the following properties:
 *
 * @property string $inputFilename   The original input filename
 * @property string $inputFilePath   The full path to the input file
 * @property string $outputFilename  The converted output filename
 * @property string $outputFilePath  The full path to the converted output file
 * @property string $toFormat       The format the file was converted to (e.g. 'pdf')
 * @property string $duration       The time taken for conversion (e.g. "2.21 sec")
 * @property float  $startTime      Unix timestamp of when conversion started
 * @property float  $endTime        Unix timestamp of when conversion completed
 * @property string $inputDisk      The Laravel storage disk used for input
 * @property string $outputDisk     The Laravel storage disk used for output
 */

Requirements

LibreOffice & ImageMagick

This package requires LibreOffice, ImageMagick, and Potrace to be installed on your system. Here's how to install them:

Ubuntu/Debian
sudo apt update
sudo apt install libreoffice imagemagick potrace
macOS
brew install libreoffice imagemagick potrace
Windows
choco install libreoffice imagemagick potrace
Docker

If you're using Docker, you can add the required dependencies to your container:

# Ubuntu/Debian based
RUN apt-get update && apt-get install -y libreoffice imagemagick potrace

# Alpine based
RUN apk add --no-cache libreoffice imagemagick potrace

PHP Requirements

  • PHP ^8.2 (8.2 or later 8.x)
  • ext-fileinfo
  • ext-imagick
  • Laravel >= 9.0

🔁 Supported Conversions by Category

📝 Documents

From Supported Conversions
DOCX PDF ✅✅, ODT, RTF, TXT, HTML, XML, EPUB
DOC PDF ✅✅, DOCX, ODT, RTF, TXT, HTML, XML, EPUB
ODT PDF, DOCX, RTF, TXT, HTML, XML
RTF PDF, DOCX, ODT, TXT, HTML, XML
TXT PDF, DOCX, ODT, HTML, XML
HTML PDF, ODT, TXT
XML PDF, DOCX, ODT, TXT, HTML

📊 Spreadsheets

From Supported Conversions
XLSX PDF ✅✅, ODS, CSV
XLS PDF, XLSX, ODS, CSV
ODS PDF, XLSX, CSV
CSV PDF, XLSX, ODS

🎯 Presentations

From Supported Conversions
PPTX PDF ✅✅, ODP
PPT PDF, PPTX, ODP
ODP PDF, PPTX

🖼️ Images

From Supported Conversions
PNG PDF ✅, JPG, SVG, TIFF, WEBP, GIF, BMP
JPG PDF ✅, PNG, SVG, TIFF, WEBP, GIF, BMP
SVG PDF, PNG, JPG, TIFF, WEBP, GIF, BMP
BMP PDF, PNG, JPG, SVG, TIFF, WEBP, GIF
TIFF PDF, PNG, JPG, SVG, WEBP, GIF, BMP
WEBP PDF, PNG, JPG, SVG, TIFF, GIF, BMP
GIF PDF, PNG, JPG, SVG, TIFF, WEBP, BMP

Legend 🔍

  • ✅✅ = Common high-priority conversion
  • ✅ = Popular supported format
  • (unlisted) = Conversion not supported

Note: Document conversions are performed using LibreOffice in headless mode, while image format conversions utilize ImageMagick 🚀

🤝 Sponsors

If you find this package helpful, please consider sponsoring the development:

🚀 Become a GitHub Sponsor

License

Blasp is open-sourced software licensed under the MIT license.

Related Packages

blaspsoft/blasp

Blasp is a powerful and customisable profanity filter package for Laravel applic...

482,367 358
blaspsoft/onym

Onym is a lightweight Laravel package designed to generate unique, structured, a...

58,960 123
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440

Version History

Version Released PHP Laravel License
v2.0.0 ^8.2 ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v1.0.4 ^8.2 ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v1.0.3 ^8.2 ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v1.0.2 ^8.2 ^8.0|^9.0|^10.0|^11.0|^12.0 MIT
Pre-releases (1)
Version Released PHP Laravel License
0.1.0-beta ^8.2 ^8.0|^9.0|^10.0|^11.0|^12.0 MIT