code: public void restoreGraphicsState () throws IOException
    {
      if (!fontStack.isEmpty ())
      {
        fontStack.pop ();
      }
      if (!strokingColorSpaceStack.isEmpty ())
      {
        strokingColorSpaceStack.pop ();
      }
      if (!nonStrokingColorSpaceStack.isEmpty ())
      {
        nonStrokingColorSpaceStack.pop ();
      }
      writeOperator ((byte) 'Q');
    }
docs: Q operator. Restores the current graphics state.
  
  @throws IOException
  If an error occurs while writing to the stream.