sgapiSetColorPDF(%%pdf, %%r, %%g, %%b)

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language. Visit our NEW Lua Scripting Resources!

Legacy Custom Scripting Language Deprecation Plans 

  1. New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
  2. As of October 29, 2018 Custom Scripting Actions will default to Lua as the scripting type in the Custom Scripting Action for accounts created before this date. You will be able to switch to the Legacy Custom Scripting; though we highly encourage using Lua.
  3. In the long term, Legacy Custom Scripting Actions will be switched to read-only. The exact date on this is to be determined; we will send notifications well ahead of time.

This function sets the text color for the given pdf.  %%r, %%g, %%b are set to 0 (black) by default.

For more info on PHP PDF Creation visit:


The below script creates and builds a PDF object, outputs it and adds it as an attachment to a send email action. In the highlighted portion of the script we define the text color to apply to the PDF.

Check it out in an example survey


Download a survey with these scripting functions to your account

%%pdf = "Example PDF";
%%text = "Text to include in PDF";
%%size = 14;
%%options = array('spacing' => 1.5);
%%table = array( array(1,2,3,4), array(5,6,7,8), array (9,10,11,12) );
%%columns = array('Column A','Column B','Column C','Column D');

sgapiTablePDF(%%pdf,%%table,%%columns,'Table Title');

%%formattedpdf = sgapiPDFOutput(%%pdf);

%%attachment['example.pdf'] = %%formattedpdf;

//Attach to existing send email action (ID 3)