All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jpedal.parser.text.TR Maven / Gradle / Ivy

/*
 * ===========================================
 * Java Pdf Extraction Decoding Access Library
 * ===========================================
 *
 * Project Info:  http://www.idrsolutions.com
 * Help section for developers at http://www.idrsolutions.com/support/
 *
 * (C) Copyright 1997-2017 IDRsolutions and Contributors.
 *
 * This file is part of JPedal/JPDF2HTML5
 *
 @LICENSE@
 *
 * ---------------
 * TR.java
 * ---------------
 */
package org.jpedal.parser.text;

import org.jpedal.objects.GraphicsState;


public class TR {


    public static int execute(final int key, final GraphicsState gs) {

        int value = key;

        //Text render mode
        switch (key) {

            case 0:
                value = GraphicsState.FILL;
                break;

            case 1:
                value = GraphicsState.STROKE;
                break;

            case 2:
                value = GraphicsState.FILLSTROKE;
                break;

            case 3:
                value = GraphicsState.INVISIBLE;

                //allow user to over-ride
                if (Tj.showInvisibleText) {
                    value = GraphicsState.FILL;
                }

                break;

            case 7:
                value = GraphicsState.CLIPTEXT;
                break;

        }
        gs.setTextRenderType(value);

        return value;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy