Package org.apache.pdfbox.pdmodel.graphics.xobject

Examples of org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject


        String operation = operator.getOperation();
        if( operation.equals( "Do" ) )
        {
            COSName objectName = (COSName)arguments.get( 0 );
            Map xobjects = getResources().getXObjects();
            PDXObject xobject = (PDXObject)xobjects.get( objectName.getName() );
            if( xobject instanceof PDXObjectImage )
            {
                try
                {
                    PDXObjectImage image = (PDXObjectImage)xobject;
View Full Code Here


        Iterator imageNames = xobjects.keyList().iterator();
        while( imageNames.hasNext() )
        {
            COSName objName = (COSName)imageNames.next();
            COSBase cosObject = xobjects.getDictionaryObject(objName);
            PDXObject xobject = PDXObject.createXObject( cosObject );
            if( xobject !=null )
            {
                actuals.put( objName.getName(), xobject);
            }
        }
View Full Code Here

        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
            {
View Full Code Here

        COSName name = (COSName) arguments.get( 0 );

        //PDResources res = context.getResources();

        Map xobjects = context.getXObjects();
        PDXObject xobject = (PDXObject) xobjects.get(name.getName());

        if(xobject instanceof PDXObjectForm)
        {
            PDXObjectForm form = (PDXObjectForm)xobject;
            COSStream invoke = (COSStream)form.getCOSObject();
View Full Code Here

            else
            {
                xobjects = new HashMap<String,PDXObject>();
                for( COSName objName : xobjectsDictionary.keySet() )
                {
                    PDXObject xobject = null;
                    try
                    {
                        xobject = PDXObject.createXObject( xobjectsDictionary.getDictionaryObject(objName) );
                    }
                    catch (IOException exception)
View Full Code Here

        {
            Map<String,PDXObject> allXObjects = getXObjects();
            images = new HashMap<String,PDXObjectImage>();
            for( Map.Entry<String,PDXObject> entry: allXObjects.entrySet() )
            {
                PDXObject xobject = entry.getValue();
                if( xobject instanceof PDXObjectImage )
                {
                    images.put( entry.getKey(), (PDXObjectImage)xobject);
                }
            }
View Full Code Here

            return;
        }

        for (Map.Entry<String, PDXObject> entry : xObjects.entrySet()) {
                       
            PDXObject object = entry.getValue();
            if (object instanceof PDXObjectForm) {
                extractImages(((PDXObjectForm) object).getResources());
            } else if (object instanceof PDXObjectImage) {
               
                //Do we only want to process unique COSObject ids?
View Full Code Here

  protected void processOperator(PDFOperator operator, List arguments) throws IOException {
    String operation = operator.getOperation();
    if (INVOKE_OPERATOR.equals(operation)) {
      COSName objectName = (COSName) arguments.get(0);
      Map<String, PDXObject> xobjects = getResources().getXObjects();
      PDXObject xobject = xobjects.get(objectName.getName());
      if (xobject instanceof PDXObjectImage) {
        PDXObjectImage image = (PDXObjectImage) xobject;
        PDPage page = getCurrentPage();
        int imageWidth = image.getWidth();
        int imageHeight = image.getHeight();
View Full Code Here

                if (xobj != null && COSUtils.isStream(xobj, cosDocument))
                {
                    try
                    {
                        COSStream stream = COSUtils.getAsStream(xobj, cosDocument);
                        PDXObject pdXObject = PDXObject.createXObject(stream);
                        if (pdXObject != null)
                        {
                            ContextHelper.validateElement(context, pdXObject, GRAPHIC_PROCESS);
                        }
                        else
View Full Code Here

            {
                if (thumbBase instanceof COSObject)
                {
                    thumbBase = ((COSObject) thumbBase).getObject();
                }
                PDXObject thumbImg = PDXObjectImage.createXObject(thumbBase);
                ContextHelper.validateElement(context, thumbImg, GRAPHIC_PROCESS);
            }
            catch (IOException e)
            {
                context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID, "Unable to read Thumb image : "
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject

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.