Search in sources :

Example 1 with IllegalPdfSyntaxException

use of com.lowagie.text.exceptions.IllegalPdfSyntaxException in project OpenPDF by LibrePDF.

the class PdfContentByte method restoreState.

/**
 * Restores the graphic state. <CODE>saveState</CODE> and
 * <CODE>restoreState</CODE> must be balanced.
 */
public void restoreState() {
    content.append("Q").append_i(separator);
    int idx = stateList.size() - 1;
    if (idx < 0)
        throw new IllegalPdfSyntaxException(MessageLocalization.getComposedMessage("unbalanced.save.restore.state.operators"));
    if (stateList.get(idx) != null) {
        state.restore(stateList.get(idx));
    }
    stateList.remove(idx);
}
Also used : IllegalPdfSyntaxException(com.lowagie.text.exceptions.IllegalPdfSyntaxException)

Example 2 with IllegalPdfSyntaxException

use of com.lowagie.text.exceptions.IllegalPdfSyntaxException in project itext2 by albfernandez.

the class PdfContentByte method restoreState.

/**
 * Restores the graphic state. <CODE>saveState</CODE> and
 * <CODE>restoreState</CODE> must be balanced.
 */
public void restoreState() {
    content.append("Q").append_i(separator);
    int idx = stateList.size() - 1;
    if (idx < 0)
        throw new IllegalPdfSyntaxException("Unbalanced save/restore state operators.");
    state = (GraphicState) stateList.get(idx);
    stateList.remove(idx);
}
Also used : IllegalPdfSyntaxException(com.lowagie.text.exceptions.IllegalPdfSyntaxException)

Aggregations

IllegalPdfSyntaxException (com.lowagie.text.exceptions.IllegalPdfSyntaxException)2