void PSOutputDev::endTextObject(GfxState *state) {
  if (haveCSPattern) {
    if (haveTextClip) {
      writePS("Tclip*\n");
      haveTextClip = gFalse;
      if (state->getFillColorSpace()->getMode() != csPattern) {
        double cxMin, cyMin, cxMax, cyMax;
        state->getClipBBox(&cxMin, &cyMin, &cxMax, &cyMax);
        writePSFmt("{0:.6g} {1:.6g} {2:.6g} {3:.6g} re\n",
                   cxMin, cyMin,
                   cxMax, cyMax);
        writePS("f*\n");
        restoreState(state);
        updateFillColor(state);
      }
    }
    haveCSPattern = gFalse;
  } else if (haveTextClip) {
    writePS("Tclip\n");
    haveTextClip = gFalse;
  }
}
void PSOutputDev::endTextObject(GfxState *state) {
  if (haveCSPattern) {
    if (haveTextClip) {
      writePS("Tclip*\n");
      haveTextClip = gFalse;
      if (state->getFillColorSpace()->getMode() != csPattern) {
        double cxMin, cyMin, cxMax, cyMax;
        state->getClipBBox(&cxMin, &cyMin, &cxMax, &cyMax);
        writePSFmt("{0:.6g} {1:.6g} {2:.6g} {3:.6g} re\n",
                   cxMin, cyMin,
                   cxMax, cyMax);
        writePS("f*\n");
        restoreState(state);
        updateFillColor(state);
      }
    }
    haveCSPattern = gFalse;
  } else if (haveTextClip) {
    writePS("Tclip\n");
    haveTextClip = gFalse;
  }
}