Seamless Document Conversion in Laravel With Docswap
Doxswap is a Laravel package for seamless document conversion using LibreOffice. It effortlessly converts DOCX, PDF, ODT, and more with a simple, elegant API. It supports Laravel storage, configurable settings, and secure file handling.
At the time of writing, Docswap supports the following conversions:
$convertedFile = Doxswap::convert('sample.docx', 'pdf'); /*** Returns a Doxswap object with the following properties:** @property string $inputFile The original input filename* @property string $outputFile The full path to the converted output file* @property string $toFormat The format the file was converted to (e.g. 'pdf')* @property ConversionService $conversionService The service used for conversion*/- Documents: DOC, DOCX, ODT, RTF, TXT
- Spreadsheets: XLS, XLSX, ODS, CSV
- Presentations: PPT, PPTX, ODP
- Images: JPG, PNG, SVG, BMP, TIFF
- Web: HTML, XML
- Other: PDF, EPUB
Main Features
- Multiple Format Support – Convert between DOCX, PDF, ODT, and other document formats.
- Simple API – Easy-to-use interface for document conversion operations.
- Laravel Storage Integration – Works seamlessly with Laravel's filesystem drivers.
- Efficient Processing – Optimized conversion using LibreOffice's powerful engine.
- Secure File Handling – Safe and secure document processing with proper cleanup.
- Configurable Settings – Customize paths, storage disks, and conversion options.
- Error Handling – Robust exception handling for unsupported formats and conversions.