@@ -190,6 +190,11 @@ public function generateAcceptancePdf($data, $pdf_filename) {
190190 }
191191
192192 $ pdf ->Ln ();
193+
194+ // Check for CJK in the translation string for date. (This is a good proxy for the rest of the document)
195+ Helper::hasRtl (trans ('general.date ' )) ? $ pdf ->setRTL (true ) : $ pdf ->setRTL (false );
196+ Helper::isCjk (trans ('general.date ' )) ? $ pdf ->SetFont ('cid0cs ' , '' , 9 ) : $ pdf ->SetFont ('dejavusans ' , '' , 8 , '' , true );
197+
193198 $ pdf ->writeHTML (trans ('general.date ' ) . ': ' . Helper::getFormattedDateObject (now (), 'datetime ' , false ), true , 0 , true , 0 , '' );
194199
195200 if ($ data ['company_name ' ] != null ) {
@@ -224,7 +229,6 @@ public function generateAcceptancePdf($data, $pdf_filename) {
224229 foreach ($ eula_lines as $ eula_line ) {
225230 Helper::hasRtl ($ eula_line ) ? $ pdf ->setRTL (true ) : $ pdf ->setRTL (false );
226231 Helper::isCjk ($ eula_line ) ? $ pdf ->SetFont ('cid0cs ' , '' , 9 ) : $ pdf ->SetFont ('dejavusans ' , '' , 8 , '' , true );
227-
228232 $ pdf ->writeHTML (Helper::parseEscapedMarkedown ($ eula_line ), true , 0 , true , 0 , '' );
229233 }
230234 $ pdf ->Ln ();
@@ -239,8 +243,11 @@ public function generateAcceptancePdf($data, $pdf_filename) {
239243 $ pdf ->Ln ();
240244 }
241245
246+ Helper::hasRtl (trans ('general.notes ' )) ? $ pdf ->setRTL (true ) : $ pdf ->setRTL (false );
247+ Helper::isCjk (trans ('general.notes ' )) ? $ pdf ->SetFont ('cid0cs ' , '' , 9 ) : $ pdf ->SetFont ('dejavusans ' , '' , 8 , '' , true );
248+
242249 if ($ data ['note ' ] != null ) {
243- Helper::isCjk ($ data [ ' note ' ] ) ? $ pdf ->SetFont ('cid0cs ' , '' , 9 ) : $ pdf ->SetFont ('dejavusans ' , '' , 8 , '' , true );
250+ Helper::isCjk (trans ( ' general.notes ' ) ) ? $ pdf ->SetFont ('cid0cs ' , '' , 9 ) : $ pdf ->SetFont ('dejavusans ' , '' , 8 , '' , true );
244251 $ pdf ->writeHTML (trans ('general.notes ' ) . ': ' . e ($ data ['note ' ]), true , 0 , true , 0 , '' );
245252 $ pdf ->Ln ();
246253 }
0 commit comments