M
M
Meridian3122013-12-07 18:32:27
PHP
Meridian312, 2013-12-07 18:32:27

Is it possible to speed up the process of converting doc to pdf with LibreOffice?

Faced such a problem that the conversion of a .docx document takes a long time, are there any solutions to somehow speed up the conversion process. Other scripts, software or methods?
Here is the code to convert.
Win Apache LibreOffice

$config = array(
  "lib_office_exe" => '"D:/LibreOffice 4/program/soffice.exe"'
);

function convert_to_pdf($filepath)
{
  global $config;
  exec($config['lib_office_exe'] . " --headless --invisible --convert-to pdf " 
    . $_SERVER['DOCUMENT_ROOT'] . '/' . $filepath 
    . " --outdir " . $_SERVER['DOCUMENT_ROOT'] . "/temp/");

  header("Location: /temp/" . basename($filepath, ".docx") . ".pdf");

}

convert_to_pdf("PSF.docx");

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ivandulin1000, 2014-12-02
@ivandulin1000

I don't know, I always convert with TotalPDFConverter . Turns out pretty fast

E
Eugene, 2013-12-07
@Nc_Soft

So it can be a problem on Windows?
Is it in production too long?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question