metin_nn adlı üyeden alıntı:
mesajı görüntüle
- bilgisayara lokal bir sunucu kurun hocam örnek xampp,
- daha sonra https://getcomposer.org/download/ buradan composer indir.
- başlat'a cmd yazın ve terminale girin.
- composer yazın.
- cd desktop yazarak masaüstü dizinini belirleyin.
- composer require dompdf/dompdf bunu yazıp entere basın.
- akabinde masaüstünde bir vendor dosyası oluşacak.
include '../vendor/autoload.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;
// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml('hello world');
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream();bu basit bir örneği. hello worl'de php ile veri ekleyebilirsiniz veya bir html sayfaya yönlendirebilirsiniz ve o sayfada php çalıştırıp çıktı alabilirsiniz.Örnek olması içinde;
$dompdf->loadHtml('hello world');
yerine
$dompdf->loadHtml( file_get_contents( 'siteadresi.com/fatura.php?id=988'), 'UTF-8' );
fatura.php'dede istediğiniz php yapısını id ile verileri listeleyebilirsiniz.