Examples of COSName


Examples of org.apache.pdfbox.cos.COSName

                        COSStream encodingStream = (COSStream)encoding;
                        parseCmap( null, encodingStream.getUnfilteredStream(), null );
                    }
                    else if( isType0Font() && encoding instanceof COSName )
                    {
                        COSName encodingName = (COSName)encoding;
                        cmap = cmapObjects.get( encodingName );
                        if( cmap == null )
                        {
                            String cmapName = encodingName.getName();
                            if (encodingName.getName().equals( COSName.IDENTITY_H.getName() ))
                            {
                                COSArray descendantFontArray =
                                    (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
                                if (descendantFontArray != null)
                                {
                                    COSDictionary descendantFontDictionary =
                                        (COSDictionary)descendantFontArray.getObject( 0 );
                                    PDFont descendentFont = PDFontFactory.createFont( descendantFontDictionary );
                                    COSDictionary cidsysteminfo =
                                        (COSDictionary)descendentFont.font.getDictionaryObject(COSName.CIDSYSTEMINFO);
                                    if (cidsysteminfo != null)
                                    {
                                        String ordering = cidsysteminfo.getString(COSName.ORDERING);
                                        String registry = cidsysteminfo.getString(COSName.REGISTRY);
                                        cmapName = registry + "-" + ordering+"-UCS2";
                                    }
                                }
                            }
                            else
                            {
                                cmapName = CMapSubstitution.substituteCMap( cmapName );
                            }

                            String resourceRoot = "org/apache/pdfbox/resources/cmap/";
                            String resourceName = resourceRoot + cmapName;
                            parseCmap( resourceRoot, ResourceLoader.loadResource( resourceName ), encodingName );
                            if( cmap == null && !encodingName.getName().equals( COSName.IDENTITY_H.getName() ) )
                            {
                                throw new IOException( "Error: Could not find predefined " +
                                "CMAP file for '" + encodingName.getName() + "'" );
                            }
                        }
                    }
                    else if( encoding instanceof COSName ||
                             encoding instanceof COSDictionary )
View Full Code Here

Examples of org.pdfbox.cos.COSName

    public void copyIntoGraphicsState( PDGraphicsState gs ) throws IOException
    {
        Iterator keys = graphicsState.keyList().iterator();
        while( keys.hasNext() )
        {
            COSName key = (COSName)keys.next();
            if( key.equals( LW ) )
            {
                gs.setLineWidth( getLineWidth().doubleValue() );
            }
            else if( key.equals( LC ) )
            {
                gs.setLineCap( getLineCapStyle() );
            }
            else if( key.equals( LJ ) )
            {
                gs.setLineJoin( getLineJoinStyle() );
            }
            else if( key.equals( ML ) )
            {
                gs.setMiterLimit( getMiterLimit().doubleValue() );
            }
            else if( key.equals( D ) )
            {
                gs.setLineDashPattern( getLineDashPattern() );
            }
            else if( key.equals( RI ) )
            {
                gs.setRenderingIntent( getRenderingIntent() );
            }
            else if( key.equals( OPM ) )
            {
                gs.setOverprintMode( getOverprintMode().doubleValue() );
            }
            else if( key.equals( FONT ) )
            {
                PDFontSetting setting = getFontSetting();
                gs.getTextState().setFont( setting.getFont() );
                gs.getTextState().setFontSize( setting.getFontSize() );
            }
            else if( key.equals( FL ) )
            {
                gs.setFlatness( getFlatnessTolerance().floatValue() );
            }
            else if( key.equals( SM ) )
            {
                gs.setSmoothness( getSmoothnessTolerance().floatValue() );
            }
            else if( key.equals( SA ) )
            {
                gs.setStrokeAdjustment( getAutomaticStrokeAdjustment() );
            }
            else if( key.equals( CA ) )
            {
                gs.setAlphaConstants( getStrokingAlpaConstant().floatValue() );
            }/**
            else if( key.equals( CA_NS ) )
            {
            }**/
            else if( key.equals( AIS ) )
            {
                gs.setAlphaSource( getAlphaSourceFlag() );
            }
            else if( key.equals( TK ) )
            {
                gs.getTextState().setKnockoutFlag( getTextKnockoutFlag() );
            }
        }
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

            dictionary.setItem( COSName.getPDFName( "Colorants" ), colorants );
        }
        Iterator iter = colorants.keyList().iterator();
        while( iter.hasNext() )
        {
            COSName name = (COSName)iter.next();
            COSBase value = colorants.getDictionaryObject( name );
            actuals.put( name.getName(), PDColorSpaceFactory.createColorSpace( value ) );
        }
        return new COSDictionaryMap( actuals, colorants );
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

     *
     * @return The name in the separation.
     */
    public String getColorantName()
    {
        COSName name = (COSName)array.getObject( 1 );
        return name.getName();
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

     * @return The name of the appearance stream.
     */
    public String getAppearanceStream()
    {
        String retval = null;
        COSName name = (COSName)getDictionary().getDictionaryObject( COSName.getPDFName( "AS" ) );
        if( name != null )
        {
            retval = name.getName();
        }
        return retval;
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

            retval = createColorSpace( ((COSName)colorSpace).getName() );
        }
        else if( colorSpace instanceof COSArray )
        {
            COSArray array = (COSArray)colorSpace;
            COSName type = (COSName)array.getObject( 0 );
            if( type.getName().equals( PDCalGray.NAME ) )
            {
                retval = new PDCalGray( array );
            }
            else if( type.getName().equals( PDCalRGB.NAME ) )
            {
                retval = new PDCalRGB( array );
            }
            else if( type.getName().equals( PDDeviceN.NAME ) )
            {
                retval = new PDDeviceN( array );
            }
            else if( type.getName().equals( PDIndexed.NAME ) ||
                   type.getName().equals( PDIndexed.ABBREVIATED_NAME ))
            {
                retval = new PDIndexed( array );
            }
            else if( type.getName().equals( PDLab.NAME ) )
            {
                retval = new PDLab( array );
            }
            else if( type.getName().equals( PDSeparation.NAME ) )
            {
                retval = new PDSeparation( array );
            }
            else if( type.getName().equals( PDICCBased.NAME ) )
            {
                retval = new PDICCBased( array );
            }
            else if( type.getName().equals( PDPattern.NAME ) )
            {
                retval = new PDPattern( array );
            }
            else
            {
View Full Code Here

Examples of org.pdfbox.cos.COSName

        Map actuals = new HashMap();
        Map retval = new COSDictionaryMap( actuals, map );
        Iterator asNames = map.keyList().iterator();
        while( asNames.hasNext() )
        {
            COSName asName = (COSName)asNames.next();
            COSStream as = (COSStream)map.getDictionaryObject( asName );
            actuals.put( asName.getName(), new PDAppearanceStream( as ) );
        }

        return retval;
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

            Map actuals = new HashMap();
            retval = new COSDictionaryMap( actuals, map );
            Iterator asNames = map.keyList().iterator();
            while( asNames.hasNext() )
            {
                COSName asName = (COSName)asNames.next();
                COSStream as = (COSStream)map.getDictionaryObject( asName );
                actuals.put( asName.getName(), new PDAppearanceStream( as ) );
            }
        }

        return retval;
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

            Map actuals = new HashMap();
            retval = new COSDictionaryMap( actuals, map );
            Iterator asNames = map.keyList().iterator();
            while( asNames.hasNext() )
            {
                COSName asName = (COSName)asNames.next();
                COSStream as = (COSStream)map.getDictionaryObject( asName );
                actuals.put( asName.getName(), new PDAppearanceStream( as ) );
            }
        }

        return retval;
    }
View Full Code Here

Examples of org.pdfbox.cos.COSName

        {

            Iterator iterKeys = sourceDict.keyList().iterator();
            while (iterKeys.hasNext())
            {
                COSName key = (COSName) iterKeys.next();
                COSName mappedKey = (COSName) objectNameMap.get(key.getName());
                if (mappedKey == null)
                {
                    // object not needet
                    continue;
                }
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.