word to pdf

save($pdfFile); // Download PDF header(‘Content-Type: application/pdf’); header(‘Content-Disposition: attachment; filename=”‘ . basename($pdfFile) . ‘”‘); readfile($pdfFile); // Cleanup unlink($upload_file); unlink($pdfFile); exit; } catch (Exception $e) { wp_die(‘Error converting file: ‘ . $e->getMessage()); } } add_action(‘admin_post_convert_word_to_pdf’, ‘convert_word_to_pdf’); add_action(‘admin_post_nopriv_convert_word_to_pdf’, ‘convert_word_to_pdf’);