Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSDictionary


    s = di.getSubject();
    if (s != null)
      entry.setField("abstract", s);

    COSDictionary dict = di.getDictionary();
    Iterator it = dict.keyList().iterator();
    while (it.hasNext()) {
      String key = ((COSName) it.next()).getName();
      if (key.startsWith("bibtex/")) {
        String value = dict.getString(key);
        key = key.substring("bibtex/".length());
        if (key.equals("entrytype")) {
          BibtexEntryType type = BibtexEntryType
              .getStandardType(value);
          if (type != null)
View Full Code Here


    /**
     * Default constructor, creates blank graphics state.
     */
    public PDExtendedGraphicsState()
    {
        graphicsState = new COSDictionary();
        graphicsState.setItem( COSName.TYPE, COSName.getPDFName( "ExtGState" ) );
    }
View Full Code Here

    /**
     * Constructor.
     */
    public PDDeviceNAttributes()
    {
        dictionary = new COSDictionary();
    }
View Full Code Here

     * @throws IOException If there is an error getting the colorspaces.
     */
    public Map getColorants() throws IOException
    {
        Map actuals = new HashMap();
        COSDictionary colorants = (COSDictionary)dictionary.getDictionaryObject( COSName.getPDFName( "Colorants" ) );
        if( colorants == null )
        {
            colorants = new COSDictionary();
            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

     *
     * @param colorants The map of colorants.
     */
    public void setColorants( Map colorants )
    {
        COSDictionary colorantDict = null;
        if( colorants != null )
        {
            colorantDict = COSDictionaryMap.convert( colorants );
        }
        dictionary.setItem( COSName.getPDFName( "Colorants" ), colorantDict );
View Full Code Here

     *
     * @return The previous URI.
     */
    public PDActionURI getPreviousURI()
    {
        COSDictionary pa = (COSDictionary) getDictionary().getDictionaryObject("PA");
        if ( pa != null )
        {
            return new PDActionURI( pa );
        }
        else
View Full Code Here

    public static PDAnnotation createAnnotation( COSBase base ) throws IOException
    {
        PDAnnotation annot = null;
        if( base instanceof COSDictionary )
        {
            COSDictionary annotDic = (COSDictionary)base;
            String subtype = annotDic.getNameAsString( COSName.SUBTYPE );
            if( subtype.equals( PDAnnotationRubberStamp.SUB_TYPE ) )
            {
                annot = new PDAnnotationRubberStamp(annotDic);
            }
            else if( subtype.equals( PDAnnotationLink.SUB_TYPE ) )
View Full Code Here

    /**
     * Constructor.
     */
    public PDAnnotation()
    {
        dictionary = new COSDictionary();
        dictionary.setItem( COSName.TYPE, COSName.getPDFName( "Annot" ) );
    }
View Full Code Here

     * @return This annotations appearance.
     */
    public PDAppearanceDictionary getAppearance()
    {
        PDAppearanceDictionary ap = null;
        COSDictionary apDic = (COSDictionary)dictionary.getDictionaryObject( COSName.getPDFName( "AP" ) );
        if( apDic != null )
        {
            ap = new PDAppearanceDictionary( apDic );
        }
        return ap;
View Full Code Here

     *
     * @param appearance The appearance dictionary for this annotation.
     */
    public void setAppearance( PDAppearanceDictionary appearance )
    {
        COSDictionary ap = null;
        if( appearance != null )
        {
            ap = appearance.getDictionary();
        }
        dictionary.setItem( COSName.getPDFName( "AP" ), ap );
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSDictionary

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.