Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSNumber.doubleValue()


        if (result instanceof COSNumber)
        {
            COSNumber number = (COSNumber) result;
            if (number instanceof COSFloat)
            {
                Double real = number.doubleValue();
                if (real > MAX_POSITIVE_FLOAT || real < MAX_NEGATIVE_FLOAT)
                {
                    addValidationError(new ValidationError(ERROR_SYNTAX_NUMERIC_RANGE,
                            "Float is too long or too small: " + real));
                }
View Full Code Here


        double x1 = x.doubleValue();
        double y1 = y.doubleValue();
        // create a pair of coordinates for the transformation
        double x2 = w.doubleValue()+x1;
        double y2 = h.doubleValue()+y1;

        Point2D startCoords = drawer.transformedPoint(x1,y1);
        Point2D endCoords = drawer.transformedPoint(x2,y2);

        float width = (float)(endCoords.getX()-startCoords.getX());
View Full Code Here

        COSNumber x3 = (COSNumber)arguments.get( 4 );
        COSNumber y3 = (COSNumber)arguments.get( 5 );

        Point2D point1 = drawer.transformedPoint(x1.doubleValue(), y1.doubleValue());
        Point2D point2 = drawer.transformedPoint(x2.doubleValue(), y2.doubleValue());
        Point2D point3 = drawer.transformedPoint(x3.doubleValue(), y3.doubleValue());

        drawer.getLinePath().curveTo((float)point1.getX(), (float)point1.getY(),
                (float)point2.getX(), (float)point2.getY(), (float)point3.getX(), (float)point3.getY());
    }
}
View Full Code Here

        try
        {
            PageDrawer drawer = (PageDrawer)context;
            COSNumber x = (COSNumber)arguments.get( 0 );
            COSNumber y = (COSNumber)arguments.get( 1 );
            Point2D pos = drawer.transformedPoint(x.doubleValue(), y.doubleValue());
            drawer.getLinePath().moveTo((float)pos.getX(), (float)pos.getY());
        }
        catch (Exception exception)
        {
            log.warn( exception, exception);
View Full Code Here

        COSNumber y3 = (COSNumber)arguments.get( 3 );
        GeneralPath path = drawer.getLinePath();
        Point2D currentPoint = path.getCurrentPoint();

        Point2D point2 = drawer.transformedPoint(x2.doubleValue(), y2.doubleValue());
        Point2D point3 = drawer.transformedPoint(x3.doubleValue(), y3.doubleValue());

        drawer.getLinePath().curveTo((float)currentPoint.getX(), (float)currentPoint.getY(),
                (float)point2.getX(), (float)point2.getY(), (float)point3.getX(), (float)point3.getY());
    }
}
View Full Code Here

     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        COSNumber miterLimit = (COSNumber)arguments.get( 0 );
        context.getGraphicsState().setMiterLimit( miterLimit.doubleValue() );
    }
}
View Full Code Here

        //append straight line segment from the current point to the point.
        COSNumber x = (COSNumber)arguments.get( 0 );
        COSNumber y = (COSNumber)arguments.get( 1 );

        Point2D pos = drawer.transformedPoint(x.doubleValue(), y.doubleValue());
        drawer.getLinePath().lineTo((float)pos.getX(), (float)pos.getY());
    }
}
View Full Code Here

        double x1 = x.doubleValue();
        double y1 = y.doubleValue();
        // create a pair of coordinates for the transformation
        double x2 = w.doubleValue()+x1;
        double y2 = h.doubleValue()+y1;

        Point2D startCoords = drawer.transformedPoint(x1,y1);
        Point2D endCoords = drawer.transformedPoint(x2,y2);

        float width = (float)(endCoords.getX()-startCoords.getX());
View Full Code Here

        COSNumber y1 = (COSNumber)arguments.get( 1 );
        COSNumber x3 = (COSNumber)arguments.get( 2 );
        COSNumber y3 = (COSNumber)arguments.get( 3 );

        Point2D point1 = drawer.transformedPoint(x1.doubleValue(), y1.doubleValue());
        Point2D point3 = drawer.transformedPoint(x3.doubleValue(), y3.doubleValue());

        drawer.getLinePath().curveTo((float)point1.getX(), (float)point1.getY(),
                (float)point3.getX(), (float)point3.getY(), (float)point3.getX(), (float)point3.getY());
    }
}
View Full Code Here

     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
    {
        COSNumber width = (COSNumber)arguments.get( 0 );
        context.getGraphicsState().setLineWidth( width.doubleValue() );
    }
}
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.