use PhpOffice\PhpWord\PhpWord; add_action('wp_ajax_amt_generate_docx','amt_generate_docx'); add_action('wp_ajax_nopriv_amt_generate_docx','amt_generate_docx'); function amt_generate_docx(){ $data = json_decode(file_get_contents("php://input"),true); $text = $data['text']; $phpWord = new PhpWord(); $section = $phpWord->addSection(); $section->addText($text); $tmp = tempnam(sys_get_temp_dir(),'docx'); $writer = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord,'Word2007'); $writer->save($tmp); header("Content-Disposition: attachment; filename=transcription.docx"); readfile($tmp); unlink($tmp); exit; }

Our site is coming soon

We are doing some maintenance on our site. It won't take long, we promise. Come back and visit us again in a few days. Thank you for your patience!