<?php
require 'vendor/autoload.php';

use Dompdf\Dompdf;
use Dompdf\Options;

if (isset($_GET['type']) && $_GET['type'] == 'pdf') {
    $options = new Options();
    $options->set('defaultFont', 'Courier');
    
    $dompdf = new Dompdf($options);
    $html = file_get_contents('http://yourwebsite.com/index.html#content'); // Replace with your actual content path
    
    $dompdf->loadHtml($html);
    $dompdf->setPaper('A4', 'portrait');
    $dompdf->render();
    $dompdf->stream("content.pdf", array("Attachment" => true));
}
?>