Mpdf\MpdfException

Unable to set PDF file protection, CSPRNG Functions are not available. Use paragonie/random_compat polyfill or upgrade to PHP 7.

/home/s/srobos/reestr.sro-bos.ru_new/public_html/vendor/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php(11)

01 <?php
02 
03 namespace Mpdf\Pdf\Protection;
04 
05 class UniqidGenerator
06 {
07 
08     public function __construct()
09     {
10         if (!function_exists('random_int') || !function_exists('random_bytes')) {
11             throw new \Mpdf\MpdfException(
12                 'Unable to set PDF file protection, CSPRNG Functions are not available. '
13                 . 'Use paragonie/random_compat polyfill or upgrade to PHP 7.'
14             );
15         }
16     }
17 
18     /**
19      * @return string
20      */
21     public function generate()
22     {
23         $chars = 'ABCDEF1234567890';

Stack Trace

#0
+
 /home/s/srobos/reestr.sro-bos.ru_new/public_html/vendor/mpdf/mpdf/src/ServiceFactory.php(68): Mpdf\Pdf\Protection\UniqidGenerator->__construct()
63 
64         $cssManager = new CssManager($mpdf, $cache, $sizeConverter, $colorConverter);
65 
66         $otl = new Otl($mpdf, $fontCache);
67 
68         $protection = new Protection(new UniqidGenerator());
69 
70         $writer = new BaseWriter($mpdf, $protection);
71 
72         $gradient = new Gradient($mpdf, $sizeConverter, $colorConverter, $writer);
73 
#1
+
 /home/s/srobos/reestr.sro-bos.ru_new/public_html/vendor/mpdf/mpdf/src/Mpdf.php(1063): Mpdf\ServiceFactory->getServices(Mpdf\Mpdf, Psr\Log\NullLogger, array("tempDir" => "/home/s/srobos/reestr.sro-bos.ru_new/public_html/protected/runti...", "mirrorMargins" => 0, "forcePortraitMargins" => false, "displayDefaultOrientation" => false, ...), 0, ...)
1058             $this->scriptToLanguage,
1059             $this->fontDescriptor,
1060             $this->bmp,
1061             $this->directWrite,
1062             $this->wmf
1063         );
1064 
1065         $this->services = [];
1066 
1067         foreach ($services as $key => $service) {
1068             $this->{$key} = $service;
#2
+
 /home/s/srobos/reestr.sro-bos.ru_new/public_html/protected/components/SavedAsPsd.php(45): Mpdf\Mpdf->__construct(array("tempDir" => "/home/s/srobos/reestr.sro-bos.ru_new/public_html/protected/runti..."))
40             mkdir($folderForSave, 0775, true);
41         }
42 
43         if(empty($this->fileName)){
44             $destination = Destination::INLINE;
45             $mpdf = new Mpdf(['tempDir' => $tempDir]);
46             $mpdf->WriteHTML($this->content);
47             $mpdf->Output('member_card.pdf', $destination);    
48         } else {
49             $destination = Destination::FILE;
50             $mpdf = new Mpdf(['tempDir' => $tempDir]);
2024-03-28 22:42:46 Apache/2.4.55 (Unix) Yii Framework/1.1.13