Last active
November 28, 2017 09:39
-
-
Save JonasJasas/11a6db8640c02114605512d238f1a457 to your computer and use it in GitHub Desktop.
Conversion from DOCX to PDF example. Conversion result will be saved as local file. Replace XXXXXXXX with your API secret.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_POST, true); | |
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/octet-stream')); | |
curl_setopt($curl, CURLOPT_URL, "https://v2.convertapi.com/docx/to/pdf?secret=XXXXXXXXXXXX"); | |
curl_setopt($curl, CURLOPT_POSTFIELDS, array('file' => new CurlFile('C:\my_file.docx'))); | |
file_put_contents("result.pdf", curl_exec($curl)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment