Korzystam z kompresji / biblioteki FPDF do generowania PDFa.
Mój skrypt się wykonuje, ale nie chcę się skompresować do mniejszych rozmiarów.
Używam takiego skryptu :
<?php require('pdf7/fpdf.php'); $pdf=new FPDF(); $pdf->Open(); $pdf->AddPage('L'); $pdf->AddFont('arial_ce','','arial_ce.php'); $pdf->AddFont('arial_ce','I','arial_ce_i.php'); $pdf->AddFont('arial_ce','B','arial_ce_b.php'); $pdf->AddFont('arial_ce','BI','arial_ce_bi.php'); $pdf -> SetFont('arial_ce', 'B', 16); $pdf->MultiCell(0,5, 'Tekst, który zostanie wygenerowany za pomocą Biblioteki FPDF. łźóżść',0, 'J',0); $x = $pdf->GetX(); $y = $pdf->GetY(); $pdf->SetXY($x, $y+10); $pdf->SetCompression(true); // kompresja $pdf->SetAuthor('Ceer'); //ustawia autora dokumentu $pdf->SetCreator('Dokument generowany przy pomocy skryptu'); //ustawia generator dokumentu $pdf->SetKeywords('słowo_kluczowe1, słowo_kluczowe2'); //ustawia słowa kluczowe dokumentu $pdf->SetSubject('Nauka dynamicznego tworzenia PDFów'); //ustawia temat dokumentu $pdf->SetTitle('Jak łatwo stworzyć PDFa'); //ustawia tytuł dokumentu $pdf->SetDisplayMode(100); //domyślne powiększenie dokumentu w przeglądarce $pdf->Output(); ?>
Na serwerze cal.pl w pliku php.ini mam włączoną opcje zlib
; You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the specified encoding. ; Setting any output handler automatically turns on output buffering. ; Note: People who wrote portable scripts should not depend on this ini ; Using this ini directive may cause problems unless you know what script ; is doing. ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" ; and you cannot use both "ob_gzhandler" and "zlib.output_compression". ; Instead you must use zlib.output_handler. ;output_handler = ; Transparent output compression using the zlib library ; Valid values for this option are 'off', 'on', or a specific buffer size ; to be used for compression (default is 4KB) ; Note: Resulting chunk size may vary due to nature of compression. PHP ; compression. If you prefer a larger chunk size for better ; performance, enable output_buffering in addition. ; Note: You need to use zlib.output_handler instead of the standard ; output_handler, or otherwise the output will be corrupted. zlib.output_compression = On ;zlib.output_compression_level = 50 ; You cannot specify additional output handlers if zlib.output_compression ; is activated here. This setting does the same as output_handler but in ; a different order. zlib.output_handler = On
Co robię nie tak, proszę o pomoc bo już różnych sposobów próbowałem.
Pozdrawiam