Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert file pptx to pdf file #725

Open
duongsieu opened this issue Nov 14, 2022 · 2 comments
Open

How to convert file pptx to pdf file #725

duongsieu opened this issue Nov 14, 2022 · 2 comments

Comments

@duongsieu
Copy link

duongsieu commented Nov 14, 2022

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;
    }
@IvanSerevko
Copy link

use ncjoes/office-converter

$converter = new OfficeConverter($fullPath, $fullTmpDirPath);
$pdfFile = $converter->convertTo('pdf_name');

@sxaxmz
Copy link

sxaxmz commented Apr 8, 2023

@IvanSerevko This workaround is not valid, as there is an issue with using the library as the ConvertTo function returns an error. Reference ncjose #46.

@Progi1984 Progi1984 added this to the 1.1.0 milestone Aug 21, 2024
@Progi1984 Progi1984 modified the milestones: 1.1.0, 1.2.0 Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants