Created
October 9, 2018 19:24
-
-
Save diegoliv/e8e89b315242a72153f58404d3669b65 to your computer and use it in GitHub Desktop.
PDFShift config
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 | |
require_once('includes/vendor/pdfshift/init.php'); | |
use \PDFShift\PDFShift; | |
$pdfshift = new PDFShift( array( | |
'sandbox' => true, | |
'viewport' => '768x1024', | |
'zoom' => 0.8, | |
'css' => $this->get_pdf_css(), // custom function to get a url for the css file | |
) ); | |
$pdfshift->setMargin( array( | |
'top' => '25mm', | |
'left' => '25mm', | |
'bottom' => '25mm', | |
'right' => '25mm', | |
) ); | |
$pdfshift->convert( $content ); // content is this url: https://fcfgolivedev.staging.wpengine.com/tropical-business-class-bout-hawaii-vs-costa-rica/pdf/ | |
$save = $pdfshift->save( $file_url ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment