Package org.apache.pdfbox.pdfviewer

Examples of org.apache.pdfbox.pdfviewer.PageDrawer


        }
        color.setColorSpaceValue( values );

        if (context instanceof PageDrawer)
        {
            PageDrawer drawer = (PageDrawer)context;
            drawer.colorChanged(true);
        }
    }
View Full Code Here


     *
     * @throws IOException if something went wrong during logging
     */
    public void process(PDFOperator operator, List arguments) throws IOException
    {
        PageDrawer drawer = (PageDrawer)context;
        try
        {
            drawer.getLinePath().closePath();
        }
        catch( Throwable t )
        {
            log.warn(t, t);
        }
View Full Code Here

     * @param operator The operator that is being executed.
     * @param arguments List
     */
    public void process(PDFOperator operator, List arguments)
    {
        PageDrawer drawer = (PageDrawer)context;

        //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

    public void process(PDFOperator operator, List arguments) throws IOException
    {

        try
        {
            PageDrawer drawer = (PageDrawer)context;
            drawer.setClippingPath(GeneralPath.WIND_NON_ZERO);
        }
        catch (Exception e)
        {
            log.warn(e, e);
        }
View Full Code Here

     *
     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List arguments) throws IOException
    {
        PageDrawer drawer = (PageDrawer)context;
        GeneralPath currentPath = (GeneralPath)drawer.getLinePath().clone();

        context.processOperator( "f*", arguments );
        drawer.setLinePath( currentPath );

        context.processOperator( "S", arguments );
    }
View Full Code Here

     */
    public void process(PDFOperator operator, List arguments) throws IOException
    {
        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

     * @param operator The operator that is being executed.
     * @param arguments List
     */
    public void process(PDFOperator operator, List arguments)
    {
        PageDrawer drawer = (PageDrawer)context;
        drawer.getLinePath().reset();
    }
View Full Code Here

     * @param operator The operator that is being executed.
     * @param arguments List
     */
    public void process(PDFOperator operator, List arguments)
    {
        PageDrawer drawer = (PageDrawer)context;

        COSNumber x2 = (COSNumber)arguments.get( 0 );
        COSNumber y2 = (COSNumber)arguments.get( 1 );
        COSNumber x3 = (COSNumber)arguments.get( 2 );
        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

    public void process(PDFOperator operator, List arguments) throws IOException
    {

        try
        {
            PageDrawer drawer = (PageDrawer)context;
            drawer.setClippingPath(GeneralPath.WIND_EVEN_ODD);
        }
        catch (Exception e)
        {
            log.warn(e, e);
        }
View Full Code Here

     * @param arguments List
     * @throws IOException If there is an error invoking the sub object.
     */
    public void process(PDFOperator operator, List arguments) throws IOException
    {
        PageDrawer drawer = (PageDrawer)context;
        PDPage page = drawer.getPage();
        Dimension pageSize = drawer.getPageSize();
        Graphics2D graphics = drawer.getGraphics();
        COSName objectName = (COSName)arguments.get( 0 );
        Map xobjects = drawer.getResources().getXObjects();
        PDXObject xobject = (PDXObject)xobjects.get( objectName.getName() );
        if( xobject instanceof PDXObjectImage )
        {
            PDXObjectImage image = (PDXObjectImage)xobject;
            try
            {
                image.setGraphicsState(drawer.getGraphicsState());
                BufferedImage awtImage = image.getRGBImage();
                if (awtImage == null)
                {
                    log.warn("getRGBImage returned NULL");
                    return;//TODO PKOCH
                }
                int imageWidth = awtImage.getWidth();
                int imageHeight = awtImage.getHeight();
                double pageHeight = pageSize.getHeight();

                log.info("imageWidth: " + imageWidth + "\t\timageHeight: " + imageHeight);
       
                Matrix ctm = drawer.getGraphicsState().getCurrentTransformationMatrix();
                int pageRotation = page.findRotation();

                AffineTransform ctmAT = ctm.createAffineTransform();
                ctmAT.scale(1f/imageWidth, 1f/imageHeight);
                Matrix rotationMatrix = new Matrix();
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.pdfviewer.PageDrawer

Copyright © 2018 www.massapicom. 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.