This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Have the set* methods return a Pdfcrowd object

SpartyDan wrote on 2013-11-15:
Could you have the set methods return the Pdfcrowd object?

Currently in PHP you set attributes of the class as follows:

$pdfCrowd = new Pdfcrowd;

$pdfCrowd->setPageMargins('.5in', '.5in', '.5in', '.5in');

If each of the set methods returned the object (for example: return $this;) the code would look like this:

$pdfCrowd = new Pdfcrowd;

         ->setPageMargins('.5in', '.5in', '.5in', '.5in')

A little cleaner and easier to read.
support wrote on 2013-11-18:

Thank your for the tip, it is appreciated. We will consider adding it in future versions.
support wrote on 2017-11-22:

the client for our new API supports this feature. So you can chain setters.
Here is the link for the new API:
mermoris wrote on 2020-01-23:
Cool, is this in the latest version? Haven't used pdf crowd for a while.
support wrote on 2020-01-23:
Yes, it's in our clients starting the version 4.1.0