Package org.pdfbox.pdmodel.common

Examples of org.pdfbox.pdmodel.common.PDStream


     * @throws IOException If there is an error reading the tiff data.
     */
   
    public PDCcitt( PDDocument doc, RandomAccess raf ) throws IOException
    {
        super( new PDStream(doc),"tiff");
        // super( new PDStream( doc, null, true ), "tiff" );
       
        COSDictionary decodeParms = new COSDictionary();
       
        COSDictionary dic = getCOSStream();
View Full Code Here


     *
     * @param xobj The XObject dictionary.
     */
    public PDXObject(COSStream xobj)
    {
        xobject = new PDStream( xobj );
    }
View Full Code Here

     *
     * @param doc The doc to store the object contents.
     */
    public PDXObject(PDDocument doc)
    {
        xobject = new PDStream(doc);
        xobject.getStream().setName( COSName.TYPE, "XObject" );
    }
View Full Code Here

        {
            COSStream xstream = (COSStream)xobject;
            String subtype = xstream.getNameAsString( "Subtype" );
            if( subtype.equals( PDXObjectImage.SUB_TYPE ) )
            {
                PDStream image = new PDStream( xstream );
                // See if filters are DCT or JPX otherwise treat as Bitmap-like
                // There might be a problem with several filters, but that's ToDo until
                // I find an example
                List filters = image.getFilters();
                if( filters != null && filters.contains( COSName.DCT_DECODE.getName() ) )
                {
                    return new PDJpeg(image);
                }
                else if ( filters != null && filters.contains( COSName.CCITTFAX_DECODE.getName() ) )
View Full Code Here

            int functionType =  funcDic.getInt( "FunctionType" );
            if( function instanceof COSStream )
            {
                if( functionType == 0 )
                {
                    retval = new PDFunctionType0(new PDStream((COSStream)function));
                }
                else if( functionType == 4 )
                {
                    retval = new PDFunctionType4(new PDStream((COSStream)function));
                }
                else
                {
                    throw new IOException( "Error: Unknown stream function type " + functionType );
                }
View Full Code Here

            regionCharactersByArticle.add( new ArrayList() );
            regionCharacterList.put( regionName, regionCharactersByArticle );
            regionText.put( regionName, new StringWriter() );
        }
       
        PDStream contentStream = page.getContents();
        if( contentStream != null )
        {
            COSStream contents = contentStream.getStream();
            processPage( page, contents );
        }
    }
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

        // read the pfb
        PfbParser pfbparser = new PfbParser(pfb);
        pfb.close();

        PDStream fontStream = new PDStream(doc, pfbparser.getInputStream(),
                false);
        fontStream.getStream().setInt("Length", pfbparser.size());
        for (int i = 0; i < pfbparser.getLengths().length; i++)
        {
            fontStream.getStream().setInt("Length" + (i + 1),
                    pfbparser.getLengths()[i]);
        }
        fontStream.addCompression();
        fd.setFontFile(fontStream);

        // read the afm
        AFMParser parser = new AFMParser(afm);
        parser.parse();
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.common.PDStream

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.