Skip to content

CSS not included in converted document #50

@brysonreece

Description

@brysonreece

I'm currently accessing the Docverter API via cURL to convert some documents, like so:

$url = 'http://c.docverter.com/convert';
$fields = array(
	'from' => $_POST["inputButton"],
	'to' => $_POST["outputButton"],
	'input_files[]' => "@/" . $uploadedFilePath,
	'other_files[]' => "@retro.css"
);

//open connection
$ch = curl_init();

//set options
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //needed so that the $result=curl_exec() output is the file and isn't just true/false

//execute POST
$result = curl_exec($ch);

//close connection
curl_close($ch);

//write to file
$convertedFile = fopen($convertedFilePath, 'w');
fwrite($convertedFile, $result);
fclose($convertedFile);

Note: retro.css is located in the same directory as this page and to/from values are determined from the POST values of two separate buttons.

However, no matter what formats I try to convert from/to, the CSS contents of retro.css are never included in the converted document.

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