Examples of PsInput


Examples of org.axsl.ps.PsInput

    /**
     * {@inheritDoc}
     */
    protected byte[] getPdfContent() throws GraphicException {
        final File file = new File(getGraphic().getUrl().getFile());
        PsInput psInput = null;
        try {
            psInput = this.getPDFDocument().getPsServer().makePsInput(file);
        } catch (final IOException e) {
            throw new GraphicException("Cannot open EPS file.");
        }
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testDict01() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("3 dict");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsDictionary);
        final PsDictionary dictionary = (PsDictionary) object;
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testPop01() throws PsInterpreterException4a, PsOperatorException {
        /* First example from the PSLRM, 2nd ed. */
        PsInput input = new PsStringInput("1 2 3 pop");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        /* There should be two items remaining on the stack. */
        assertEquals(2, interpreter.getOperandStack().size());
        /* The top item should be the integer 2. */
 
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testBegin01() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("17 dict begin");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        assertEquals(0, interpreter.getOperandStack().size());
        final PsDictionary dictionary = interpreter.getDictionaryStack().peek();
        assertEquals(17, dictionary.maxLength());
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testDiv01() throws PsInterpreterException4a, PsOperatorException {
        /* First example from the PSLRM, 2nd ed. */
        PsInput input = new PsStringInput("3 2 div");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        assertEquals(1, interpreter.getOperandStack().size());
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsReal);
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testIdiv01() throws PsInterpreterException4a, PsOperatorException {
        /* First example from the PSLRM, 2nd ed. */
        PsInput input = new PsStringInput("3 2 idiv");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        assertEquals(1, interpreter.getOperandStack().size());
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testAdd01() throws PsInterpreterException4a, PsOperatorException {
        /* First example from the PSLRM, 2nd ed. */
        PsInput input = new PsStringInput("3 4 add");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        final PsInteger integer = (PsInteger) object;
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testSub01() throws PsInterpreterException4a, PsOperatorException {
        /* Inverse of the first example for "add" from the PSLRM, 2nd ed. */
        PsInput input = new PsStringInput("7 3 sub");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        final PsInteger integer = (PsInteger) object;
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testMul01() throws PsInterpreterException4a, PsOperatorException {
        /* Use the same operands as for the "add" operator tests. */
        PsInput input = new PsStringInput("3 4 mul");
        PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsInteger);
        final PsInteger integer = (PsInteger) object;
View Full Code Here

Examples of org.axsl.ps.PsInput

     * @throws PsInterpreterException4a For PostScript errors.
     * @throws PsOperatorException For PostScript operator errors.
     */
    @Test
    public void testTrueOperator01() throws PsInterpreterException4a, PsOperatorException {
        final PsInput input = new PsStringInput("true");
        final PsInterpreter4a interpreter = new PsInterpreter4a(input, null);
        interpreter.process();
        assertEquals(1, interpreter.getOperandStack().size());
        final PsObject object = interpreter.getOperandStack().pop();
        assertTrue(object instanceof PsBoolean);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.