Skip to content

How to convert file pptx to pdf file #725

@duongsieu

Description

@duongsieu

I am doing the conversion of pptx files to pdf using the PhpPresentation library, but it seems that the library does not support this yet, my code:

public static function convertFilePptxToPdf($file, $nameFile)
    {
        //Load pptx file
        $reader = \PhpOffice\PhpPresentation\IOFactory::createReader("PowerPoint2007");
        $spreadsheet = $reader->load($file);
        //Save it into PDF
        $PDFWriter = \PhpOffice\PhpPresentation\IOFactory::createWriter($spreadsheet, 'Dompdf');
        $PDFWriter->save(storage_path('app/public/files/' . $nameFile));
        return $nameFile;
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions