Skip to content

Commit

Permalink
Added CSS Media Type to PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabzIt committed Sep 6, 2019
1 parent d3c3289 commit abbbfb0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"type": "library",
"keywords": ["screenshots","PDF","DOCX","HTML","table","capture","PNG","JPG","BMP","TIFF","API","web","images","videos","animated gif","csv","xlsx","video conversion","HTML to PDF","HTML to DOCX","HTML to Image","URL to PDF","URL to DOCX","URL to Image", "Rendered HTML"],
"homepage": "https://grabz.it/",
"description": "Use our API to allow your app to create images, DOCX documents and PDF's from URL's or raw HTML. Additionally GrabzIt allows you to convert online videos into animated GIF's or HTML tables into CSV's.",
"description": "Use our API to allow your app to create images, DOCX documents, rendered HTML and PDF's from URL's or raw HTML. Additionally GrabzIt allows you to convert online videos into animated GIF's or HTML tables into CSV's.",
"license": "MIT",
"version":"3.3.5",
"version":"3.3.6",
"autoload": {
"psr-4": {
"GrabzIt\\": "lib/"
Expand Down
21 changes: 20 additions & 1 deletion lib/GrabzItPDFOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class GrabzItPDFOptions extends GrabzItBaseOptions
private $mergeId = null;
private $noCookieNotifications = false;
private $address = null;
private $cssMediaType = null;

/*
Set the width of the resulting PDF in mm.
Expand Down Expand Up @@ -143,6 +144,23 @@ public function getOrientation()
{
return $this->orientation;
}

/*
Set the CSS Media Type of the PDF to be returned: 'Print' or 'Screen'.
*/
public function setCSSMediaType($value)
{
$value = ucfirst($value);
$this->cssMediaType = $value;
}

/*
Get the CSS Media Type of the PDF to be returned.
*/
public function getCSSMediaType()
{
return $this->cssMediaType;
}

/*
Set to true if links should be included in the PDF.
Expand Down Expand Up @@ -495,7 +513,7 @@ public function _getSignatureString($applicationSecret, $callBackURL, $url = nul
$this->nullToEmpty($this->hideElement)."|".$this->nullToEmpty($this->targetElement)."|".$this->nullToEmpty($this->getExportURL())."|".
$this->nullToEmpty($this->waitForElement)."|".$this->nullToEmpty($this->getEncryptionKey())."|".$this->nullToEmpty(intval($this->noAds))."|".
$this->nullToEmpty($this->post)."|".$this->nullToEmpty($this->browserWidth)."|".$this->nullToEmpty($this->height)."|".$this->nullToEmpty($this->width)."|".
$this->nullToEmpty($this->templateVariables)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->mergeId)."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications));
$this->nullToEmpty($this->templateVariables)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->mergeId)."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".$this->nullToEmpty($this->cssMediaType);
}

public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue)
Expand Down Expand Up @@ -529,6 +547,7 @@ public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $
$params['mergeid'] = $this->nullToEmpty($this->mergeId);
$params['address'] = $this->nullToEmpty($this->address);
$params['nonotify'] = $this->nullToEmpty(intval($this->noCookieNotifications));
$params['media'] = $this->nullToEmpty($this->cssMediaType);

return $params;
}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GrabzIt 3.3
===========

This library allows you to programmatically convert HTML and URL's into images, DOCX documents, PDF's, CSV's, spreadsheets and JSON. Additionally GrabzIt allows you to convert online videos into animated GIF's.
This library allows you to programmatically convert HTML and URL's into images, DOCX documents, rendered HTML, PDF's, CSV's, spreadsheets and JSON. Additionally GrabzIt allows you to convert online videos into animated GIF's.

It is usually best to place these package files in their own directory.

Expand Down

0 comments on commit abbbfb0

Please sign in to comment.