Witam,

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 :

  1. <?php
  2. require('pdf7/fpdf.php');
  3.  
  4. $pdf=new FPDF();
  5. $pdf->Open();
  6. $pdf->AddPage('L');
  7.  
  8. $pdf->AddFont('arial_ce','','arial_ce.php');
  9. $pdf->AddFont('arial_ce','I','arial_ce_i.php');
  10. $pdf->AddFont('arial_ce','B','arial_ce_b.php');
  11. $pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
  12.  
  13. $pdf -> SetFont('arial_ce', 'B', 16);
  14.  
  15. $pdf->MultiCell(0,5, 'Tekst, który zostanie wygenerowany za pomocą Biblioteki FPDF. łźóżść',0, 'J',0);
  16.  
  17. $x = $pdf->GetX();
  18. $y = $pdf->GetY();
  19. $pdf->SetXY($x, $y+10);
  20.  
  21. $pdf->SetCompression(true); // kompresja
  22.  
  23. $pdf->SetAuthor('Ceer'); //ustawia autora dokumentu
  24. $pdf->SetCreator('Dokument generowany przy pomocy skryptu'); //ustawia generator dokumentu
  25. $pdf->SetKeywords('słowo_kluczowe1, słowo_kluczowe2'); //ustawia słowa kluczowe dokumentu
  26. $pdf->SetSubject('Nauka dynamicznego tworzenia PDFów'); //ustawia temat dokumentu
  27. $pdf->SetTitle('Jak łatwo stworzyć PDFa'); //ustawia tytuł dokumentu
  28.  
  29. $pdf->SetDisplayMode(100); //domyślne powiększenie dokumentu w przeglądarce
  30.  
  31.  
  32. $pdf->Output();
  33. ?>
  34.  


Na serwerze cal.pl w pliku php.ini mam włączoną opcje zlib

  1.  
  2. ; You can redirect all of the output of your scripts to a function. For
  3. ; example, if you set output_handler to "mb_output_handler", character
  4. ; encoding will be transparently converted to the specified encoding.
  5. ; Setting any output handler automatically turns on output buffering.
  6. ; Note: People who wrote portable scripts should not depend on this ini
  7. ; directive. Instead, explicitly set the output handler using ob_start().
  8. ; Using this ini directive may cause problems unless you know what script
  9. ; is doing.
  10. ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
  11. ; and you cannot use both "ob_gzhandler" and "zlib.output_compression".
  12. ; Note: output_handler must be empty if this is set 'On' !!!!
  13. ; Instead you must use zlib.output_handler.
  14. ;output_handler =
  15.  
  16. ; Transparent output compression using the zlib library
  17. ; Valid values for this option are 'off', 'on', or a specific buffer size
  18. ; to be used for compression (default is 4KB)
  19. ; Note: Resulting chunk size may vary due to nature of compression. PHP
  20. ; outputs chunks that are few hundreds bytes each as a result of
  21. ; compression. If you prefer a larger chunk size for better
  22. ; performance, enable output_buffering in addition.
  23. ; Note: You need to use zlib.output_handler instead of the standard
  24. ; output_handler, or otherwise the output will be corrupted.
  25. zlib.output_compression = On
  26. ;zlib.output_compression_level = 50
  27.  
  28. ; You cannot specify additional output handlers if zlib.output_compression
  29. ; is activated here. This setting does the same as output_handler but in
  30. ; a different order.
  31. zlib.output_handler = On


Co robię nie tak, proszę o pomoc bo już różnych sposobów próbowałem.

Pozdrawiam