Examples of COSStream


Examples of org.pdfbox.cos.COSStream

        //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

Examples of org.pdfbox.cos.COSStream

     * @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

Examples of org.pdfbox.cos.COSStream

     * @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

Examples of org.pdfbox.cos.COSStream

     * @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

Examples of org.pdfbox.cos.COSStream

        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

Examples of org.pdfbox.cos.COSStream

   
                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

Examples of org.pdfbox.cos.COSStream

     * @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

Examples of org.pdfbox.cos.COSStream

        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

Examples of org.pdfbox.cos.COSStream

        InputStream is = null;
        OutputStream os = null;
        try
        {
            PDStream src = page.getContents();
            PDStream dest = new PDStream( new COSStream( src.getStream(), document.getScratchFile() ) );
            importedPage.setContents( dest );
            os = dest.createOutputStream();

            byte[] buf = new byte[10240];
            int amountRead = 0;
View Full Code Here

Examples of org.pdfbox.cos.COSStream

     * @param document The document that the stream will be part of.
     * @return A new stream object.
     */
    public static PDObjectStream createStream( PDDocument document )
    {
        COSStream cosStream = new COSStream( document.getDocument().getScratchFile() );
        PDObjectStream strm = new PDObjectStream( cosStream );
        strm.getStream().setName( "Type", "ObjStm" );
        return strm;
    }
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.