Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSStream


     * @return The metadata for this object.
     */
    public PDMetadata getMetadata()
    {
        PDMetadata retval = null;
        COSStream stream = (COSStream)page.getDictionaryObject( COSName.METADATA );
        if( stream != null )
        {
            retval = new PDMetadata( stream );
        }
        return retval;
View Full Code Here


        {
            if( cmap == null )
            {
                if( font.getDictionaryObject( COSName.TO_UNICODE ) != null )
                {
                    COSStream toUnicode = (COSStream)font.getDictionaryObject( COSName.TO_UNICODE );
                    if( toUnicode != null )
                    {
                        parseCmap( toUnicode.getUnfilteredStream(), null );
                    }
                }
                else
                {
                    COSBase encoding = font.getDictionaryObject( COSName.ENCODING );
                    if( encoding instanceof COSStream )
                    {
                        COSStream encodingStream = (COSStream)encoding;
                        parseCmap( encodingStream.getUnfilteredStream(), null );
                    }
                    else if( fontSubtypeName.equals( "Type0" ) &&
                             encoding instanceof COSName )
                    {
                        COSName encodingName = (COSName)encoding;
View Full Code Here

        //font dictionary
        COSDictionary fontDescriptor = (COSDictionary) font.getDictionaryObject(
            COSName.FONT_DESC);
        if( fontDescriptor != null )
        {
            COSStream fontFile = (COSStream) fontDescriptor.getDictionaryObject(
                COSName.FONT_FILE);
            if( fontFile != null )
            {
                BufferedReader in =
                        new BufferedReader(new InputStreamReader(fontFile.getUnfilteredStream()));
                /**
                 * this section parse the FileProgram stream searching for a /Encoding entry
                 * the research stop if the entry "currentdict end" is reach or after 100 lignes
                 */
                StringTokenizer st = null;
View Full Code Here

     * @return A stream containing a Type 1 font program.
     */
    public PDStream getFontFile()
    {
        PDStream retval = null;
        COSStream stream = (COSStream)dic.getDictionaryObject( "FontFile" );
        if( stream != null )
        {
            retval = new PDStream( stream );
        }
        return retval;
View Full Code Here

     * @return A stream containing a true type font program.
     */
    public PDStream getFontFile2()
    {
        PDStream retval = null;
        COSStream stream = (COSStream)dic.getDictionaryObject( "FontFile2" );
        if( stream != null )
        {
            retval = new PDStream( stream );
        }
        return retval;
View Full Code Here

     * @return A stream containing a font program.
     */
    public PDStream getFontFile3()
    {
        PDStream retval = null;
        COSStream stream = (COSStream)dic.getDictionaryObject( "FontFile3" );
        if( stream != null )
        {
            retval = new PDStream( stream );
        }
        return retval;
View Full Code Here

        retval = new COSDictionaryMap( actuals, images );
        Iterator imageNames = images.keyList().iterator();
        while( imageNames.hasNext() )
        {
            COSName imageName = (COSName)imageNames.next();
            COSStream image = (COSStream)(images.getDictionaryObject(imageName));
           
            COSName subType =(COSName)image.getDictionaryObject(COSName.SUBTYPE);
            if( subType.equals(COSName.IMAGE) )
            {
                PDXObjectImage ximage = (PDXObjectImage)PDXObject.createXObject( image );
                if( ximage !=null )
                {    
View Full Code Here

   
                Map normalAppearance = appearance.getNormalAppearance();
                PDAppearanceStream appearanceStream = (PDAppearanceStream)normalAppearance.get( "default" );
                if( appearanceStream == null )
                {
                    COSStream cosStream = new COSStream( acroForm.getDocument().getDocument().getScratchFile() );
                    appearanceStream = new PDAppearanceStream( cosStream );
                    appearanceStream.setBoundingBox( widget.getRectangle().createRetranslatedRectangle() );
                    appearance.setNormalAppearance( appearanceStream );
                }
               
View Full Code Here

     * @return The metadata for this object.
     */
    public PDMetadata getMetadata()
    {
        PDMetadata retval = null;
        COSStream stream = (COSStream)root.getDictionaryObject( "Metadata" );
        if( stream != null )
        {
            retval = new PDMetadata( stream );
        }
        return retval;
View Full Code Here

        Character c = new Character( character );
        Image retval = (Image)images.get( c );
        if( retval == null )
        {
            COSDictionary charProcs = (COSDictionary)font.getDictionaryObject( COSName.getPDFName( "CharProcs" ) );
            COSStream stream = (COSStream)charProcs.getDictionaryObject( COSName.getPDFName( "" + character ) );
            if( stream != null )
            {
                Type3StreamParser parser = new Type3StreamParser();
                retval = parser.createImage( stream );
                images.put( c, retval );
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSStream

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.