Package org.pdfbox.pdfviewer

Examples of org.pdfbox.pdfviewer.PageDrawer


    public void process(PDFOperator operator, List arguments) throws IOException
    {
        try
        {
            super.process( operator, arguments );
            PageDrawer drawer = (PageDrawer)context;
            PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace();
            Color color = colorInstance.createColor();
            drawer.setNonStrokingColor( color );
        }
        catch( IOException e )
        {
            //ignore for now and continue drawing
        }
View Full Code Here


     * @throws IOException If an error occurs while processing the font.
     */
    public void process(PDFOperator operator, List arguments) throws IOException
    {
        super.process( operator, arguments );
        PageDrawer drawer = (PageDrawer)context;
        PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace();
        Color color = colorInstance.createColor();
        drawer.setNonStrokingColor( color );
    }
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 x = (COSNumber)arguments.get( 0 );
        COSNumber y = (COSNumber)arguments.get( 1 );
        COSNumber w = (COSNumber)arguments.get( 2 );
        COSNumber h = (COSNumber)arguments.get( 3 );
        Rectangle2D rect = new Rectangle2D.Double(
            x.doubleValue(),
            drawer.fixY( x.doubleValue(), y.doubleValue())-h.doubleValue(),
            w.doubleValue()+1,
            h.doubleValue()+1);
        drawer.getLinePath().reset();
       
        drawer.getLinePath().append( rect, false );
        //graphics.drawRect((int)x.doubleValue(), (int)(pageSize.getHeight() - y.doubleValue()),
        //                  (int)w.doubleValue(),(int)h.doubleValue() );
        //System.out.println( "<re x=\"" + x.getValue() + "\" y=\"" + y.getValue() + "\" width=\"" +
        //                                 width.getValue() + "\" height=\"" + height.getValue() + "\" >" );
    }
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;
        Graphics2D graphics = ((PageDrawer)context).getGraphics();
        graphics.setColor( drawer.getStrokingColor() );
        List subPaths = drawer.getLineSubPaths();
        for( int i=0; i<subPaths.size(); i++ )
        {
            GeneralPath subPath = (GeneralPath)subPaths.get( i );
            graphics.draw( subPath );
        }
        subPaths.clear();
        GeneralPath path = drawer.getLinePath();
        graphics.draw( path );
        path.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 x1 = (COSNumber)arguments.get( 0 );
        COSNumber y1 = (COSNumber)arguments.get( 1 );
        COSNumber x3 = (COSNumber)arguments.get( 2 );
        COSNumber y3 = (COSNumber)arguments.get( 3 );
        float x1f = x1.floatValue();
        float y1f = (float)drawer.fixY( x1f, y1.floatValue() );
        float x3f = x3.floatValue();
        float y3f = (float)drawer.fixY( x3f, y3.floatValue() );
        drawer.getLinePath().curveTo(x1f,y1f,x3f,y3f,x3f,y3f);
    }
View Full Code Here

    public void process(PDFOperator operator, List arguments) throws IOException
    {
        super.process( operator, arguments );
        try
        {
            PageDrawer drawer = (PageDrawer)context;
            PDColorSpaceInstance colorInstance = drawer.getGraphicsState().getNonStrokingColorSpace();
            Color color = colorInstance.createColor();
            drawer.setStrokingColor( color );
        }
        catch( IOException e )
        {
            //ignore for now and continue drawing
        }
View Full Code Here

     * @param arguments List
     * @throws IOException If there is an error displaying the inline image.
     */
    public void process(PDFOperator operator, List argumentsthrows IOException
    {
        PageDrawer drawer = (PageDrawer)context;
        Graphics2D graphics = drawer.getGraphics();
        //begin inline image object
        ImageParameters params = operator.getImageParameters();
        PDInlinedImage image = new PDInlinedImage();
        image.setImageParameters( params );
        image.setImageData( operator.getImageData() );
        BufferedImage awtImage = image.createImage();
       
        Matrix ctm = drawer.getGraphicsState().getCurrentTransformationMatrix();
       
        int width = awtImage.getWidth();
        int height = awtImage.getHeight();

       
View Full Code Here

     * @param arguments List
     */
    public void process(PDFOperator operator, List arguments)
    {
//      NOTE:changes here should probably also be made to FillNonZeroRule
        PageDrawer drawer = (PageDrawer)context;
        Graphics2D graphics = drawer.getGraphics();
        //linePath.closePath();
        graphics.setColor( drawer.getNonStrokingColor() );
        drawer.getLinePath().setWindingRule( GeneralPath.WIND_EVEN_ODD );
        graphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF );
        //else
        //{
            graphics.fill( drawer.getLinePath() );
        //}
            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 x1 = (COSNumber)arguments.get( 0 );
        COSNumber y1 = (COSNumber)arguments.get( 1 );
        COSNumber x2 = (COSNumber)arguments.get( 2 );
        COSNumber y2 = (COSNumber)arguments.get( 3 );
        COSNumber x3 = (COSNumber)arguments.get( 4 );
        COSNumber y3 = (COSNumber)arguments.get( 5 );
        float x1f = x1.floatValue();
        float y1f = (float)drawer.fixY( x1f, y1.floatValue() );
        float x2f = x2.floatValue();
        float y2f = (float)drawer.fixY( x2f, y2.floatValue() );
        float x3f = x3.floatValue();
        float y3f = (float)drawer.fixY( x3f, y3.floatValue() );
        drawer.getLinePath().curveTo(x1f,y1f,x2f,y2f,x3f,y3f);
    }
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 x = (COSNumber)arguments.get( 0 );
        COSNumber y = (COSNumber)arguments.get( 1 );
       
        drawer.getLineSubPaths().add( drawer.getLinePath() );
        GeneralPath newPath = new GeneralPath();
        newPath.moveTo( x.floatValue(), (float)drawer.fixY( x.doubleValue(), y.doubleValue()) );
        drawer.setLinePath( newPath );
    }
View Full Code Here

TOP

Related Classes of org.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.