Skip to content

Instantly share code, notes, and snippets.

@sidupadhyay
Created November 6, 2012 14:12
Show Gist options
  • Save sidupadhyay/4024944 to your computer and use it in GitHub Desktop.
Save sidupadhyay/4024944 to your computer and use it in GitHub Desktop.
PDFlib radial shading
PDF_save($this->pdf);
PDF_setcolor($this->pdf, "both", "rgb", 0.0, 0.0, 0.0, 0.0);
$sh = PDF_shading(
this->pdf,
"radial", $this->pdf->PAGE_WIDTH/2, $this->pdf->PAGE_HEIGHT/2,
$this->pdf->PAGE_WIDTH/2, $this->pdf->PAGE_HEIGHT/2,
1.0, 0.5, 0.5, 0.0,
"r0 0 r1 500"
);
PDF_rect(this->pdf, 0, 0, $this->pdf->PAGE_WIDTH, $this->pdf->PAGE_HEIGHT);
PDF_clip(this->pdf);
PDF_shfill(this->pdf, $sh);
PDF_restore(this->pdf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment