Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSArray


     */
    protected void proceedDecryption() throws IOException, CryptographyException
    {           
   
        COSDictionary trailer = document.getDocument().getTrailer();
        COSArray fields = (COSArray)trailer.getObjectFromPath( "Root/AcroForm/Fields" );
   
        //We need to collect all the signature dictionaries, for some
        //reason the 'Contents' entry of signatures is not really encrypted
        if( fields != null )
        {
            for( int i=0; i<fields.size(); i++ )
            {
                COSDictionary field = (COSDictionary)fields.getObject( i );
                addDictionaryAndSubDictionary( potentialSignatures, field );
            }
        }

        List allObjects = document.getDocument().getObjects();
View Full Code Here


    }
   
    private void addDictionaryAndSubDictionary( Set set, COSDictionary dic )
    {
        set.add( dic );
        COSArray kids = (COSArray)dic.getDictionaryObject( "Kids" );
        for( int i=0; kids != null && i<kids.size(); i++ )
        {
            addDictionaryAndSubDictionary( set, (COSDictionary)kids.getObject( i ) );
        }
        COSBase value = dic.getDictionaryObject( "V" );
        if( value instanceof COSDictionary )
        {
            addDictionaryAndSubDictionary( set, (COSDictionary)value );
View Full Code Here

     *
     *@return The guideline color.
     */
    public PDColorSpaceInstance getGuidelineColor()
    {
        COSArray colorValues = (COSArray)dictionary.getDictionaryObject( "C" );
        if( colorValues == null )
        {
            colorValues = new COSArray();
            colorValues.add( COSInteger.ZERO );
            colorValues.add( COSInteger.ZERO );
            colorValues.add( COSInteger.ZERO );
            dictionary.setItem( "C", colorValues );
        }
        PDColorSpaceInstance instance = new PDColorSpaceInstance( colorValues );
        instance.setColorSpace( PDDeviceRGB.INSTANCE );
        return instance;
View Full Code Here

     *
     * @param color The new colorspace value.
     */
    public void setGuideLineColor( PDColorSpaceInstance color )
    {
        COSArray values = null;
        if( color != null )
        {
            values = color.getCOSColorSpaceValue();
        }
        dictionary.setItem( "C", values );
View Full Code Here

     * @return The line dash pattern.
     */
    public PDLineDashPattern getLineDashPattern()
    {
        PDLineDashPattern pattern = null;
        COSArray d = (COSArray)dictionary.getDictionaryObject( "D" );
        if( d == null )
        {
            d = new COSArray();
            d.add( new COSInteger(3) );
            dictionary.setItem( "D", d );
        }
        COSArray lineArray = new COSArray();
        lineArray.add( d );
        //dash phase is not specified and assumed to be zero.
        lineArray.add( new COSInteger( 0 ) );
        pattern = new PDLineDashPattern( lineArray );
        return pattern;
    }
View Full Code Here

     *
     * @param pattern The patter for this box style.
     */
    public void setLineDashPattern( PDLineDashPattern pattern )
    {
        COSArray array = null;
        if( pattern != null )
        {
            array = pattern.getCOSDashPattern();
        }
        dictionary.setItem( "D", array );
View Full Code Here

     *
     * @param range The new range for the a component.
     */
    public void setARange( PDRange range )
    {
        COSArray rangeArray = null;
        //if null then reset to defaults
        if( range == null )
        {
            rangeArray = getRangeArray();
            rangeArray.set( 0, new COSFloat( -100 ) );
            rangeArray.set( 1, new COSFloat( 100 ) );
        }
        else
        {
            rangeArray = range.getCOSArray();
        }
View Full Code Here

     *
     * @return The b range.
     */
    public PDRange getBRange()
    {
        COSArray range = getRangeArray();
        return new PDRange( range, 1 );
    }
View Full Code Here

     *
     * @param range The new range for the b component.
     */
    public void setBRange( PDRange range )
    {
        COSArray rangeArray = null;
        //if null then reset to defaults
        if( range == null )
        {
            rangeArray = getRangeArray();
            rangeArray.set( 2, new COSFloat( -100 ) );
            rangeArray.set( 3, new COSFloat( 100 ) );
        }
        else
        {
            rangeArray = range.getCOSArray();
        }
View Full Code Here

     *
     * Initializes to 0,0,0,0
     */
    public PDRectangle()
    {
        rectArray = new COSArray();
        rectArray.add( new COSFloat( 0.0f ) );
        rectArray.add( new COSFloat( 0.0f ) );
        rectArray.add( new COSFloat( 0.0f ) );
        rectArray.add( new COSFloat( 0.0f ) );
    }
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSArray

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.