From 0f2a9bd2827a303d4f2a04494471e48b85116aa6 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Tue, 20 Dec 2016 11:16:14 -0500 Subject: [PATCH] CRM-19761 support docx, etc export --- CRM/Contribute/Form/Task/PDFLetterCommon.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index b93bd533a0..adc1e8de9f 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -112,8 +112,17 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF //@todo - figure out why $form->_contactIds = array_keys($contacts); self::createActivities($form, $html_message, $form->_contactIds); + + //CRM-19761 if (!empty($html)) { - CRM_Utils_PDF_Utils::html2pdf($html, "CiviLetter.pdf", FALSE, $formValues); + $type = $formValues['document_type']; + + if ($type == 'pdf') { + CRM_Utils_PDF_Utils::html2pdf($html, "CiviLetter.pdf", FALSE, $formValues); + } + else { + CRM_Utils_PDF_Document::html2doc($html, "CiviLetter.$type", $formValues); + } } $form->postProcessHook(); -- 2.25.1