code: public void setGState(PdfGState gstate) {
          PdfObject obj[] = writer.addSimpleExtGState(gstate);
          PageResources prs = getPageResources();
          PdfName name = prs.addExtGState((PdfName)obj[0], (PdfIndirectReference)obj[1]);
          content.append(name.getBytes()).append(" gs").append_i(separator);
      }
docs: Sets the graphic state
  @param gstate the graphic state