Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Generating corrupted 0KB PDF #19

@Pepozzo

Description

@Pepozzo

I'm using this simple code to generate a PDF:

<?php
//include('autoload.php');
include('h2p/autoloader.php');

use H2P\Converter\PhantomJS;
use H2P\TempFile;

$filename = time();

$converter = new PhantomJS();
$input = new TempFile('<html>THIS IS A TEST</html>', 'html'); // Make sure the 2nd parameter is 'html'

// Convert destination accepts H2P\TempFile or string with the path to save the file
$converter->convert($input, $filename.'.pdf'); 
?>

The PDF is generated but it's 0 KB and Adobe Reader says it's corrupted when trying to open it.

My application is currently running on Windows 10 (via XAMPP) and I've put PhantomJS.exe (version 2.1) in h2p/bin/win32 folder.

No error are reported, even in console.

The PHP page that is running the script is placed in the root.

Any suggestion?

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