Skip to content

Corrupted PDF File generated using Windows wamp server #69

@maryglo

Description

@maryglo

Hi,
I'm using laravel framework and installed on my local machine (windows OS with wamp server installed, AMD) the package together with the binary using composer.
I created a test class. Please see below:
use mikehaertl\wkhtmlto\Pdf;
class PDFConverter {

public function __construct() {

}

public function createPDF() {
    $pdf = new Pdf('http://gmail.com/');

    $pdf->binary = base_path(). '/vendor/bin/wkhtmltopdf-amd64';
    $pdf->saveAs(base_path()."/public/documents/sample.pdf");
    //$pdf->send();
    $pdf->send('sample.pdf');
    var_dump($pdf);

}

However, the generated pdf file was 0kb and my pdf reader showed an alert with this message, "format error, not a pdf or corrupted".
 I really don't know what caused this error.

Please help. It's been weeks since I've been searching for a good package that will convert html file to pdf with too many nested tables.

  Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions