Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSName


     *
     * @param fontName The new name for the font.
     */
    public void setFontName( String fontName )
    {
        COSName name = null;
        if( fontName != null )
        {
            name = COSName.getPDFName( fontName );
        }
        dic.setItem( COSName.FONT_NAME, name );
View Full Code Here


     * @return The stretch of the font.
     */
    public String getFontStretch()
    {
        String retval = null;
        COSName name = (COSName)dic.getDictionaryObject( COSName.FONT_STRETCH );
        if( name != null )
        {
            retval = name.getName();
        }
        return retval;
    }
View Full Code Here

     *
     * @param fontStretch The new stretch for the font.
     */
    public void setFontStretch( String fontStretch )
    {
        COSName name = null;
        if( fontStretch != null )
        {
            name = COSName.getPDFName( fontStretch );
        }
        dic.setItem( COSName.FONT_STRETCH, name );
View Full Code Here

            assertTrue(ocprops.isGroupEnabled("disabled"));
            assertTrue(ocprops.setGroupEnabled("disabled", false));
            assertFalse(ocprops.isGroupEnabled("disabled"));

            //Add property lists to page resources
            COSName mc0 = COSName.getPDFName("MC0");
            COSName mc1 = COSName.getPDFName("MC1");
            COSName mc2 = COSName.getPDFName("MC2");
            resources.put(mc0, background);
            resources.put(mc1, enabled);
            resources.put(mc2, disabled);

            //Setup page content stream and paint background/title
View Full Code Here

        COSArray alternateArray;
        if(alternate == null)
        {
            alternateArray = new COSArray();
            int numComponents = getNumberOfComponents();
            COSName csName;
            if(numComponents == 1)
            {
                csName = COSName.DEVICEGRAY;
            }
            else if(numComponents == 3)
View Full Code Here

     * Returns the colorant name.
     * @return the name of the colorant
     */
    public String getColorantName()
    {
        COSName name = (COSName)array.getObject(COLORANT_NAMES);
        return name.getName();
    }
View Full Code Here

    public void addTrailerInfo(COSDictionary trailerDict)
    {
        Set<Entry<COSName, COSBase>> entrySet = trailerDict.entrySet();
        for ( Entry<COSName, COSBase> entry : entrySet )
        {
            COSName key = entry.getKey();
            if (COSName.INFO.equals(key) || COSName.ROOT.equals(key) || COSName.ENCRYPT.equals(key)
                    || COSName.ID.equals(key) || COSName.PREV.equals(key))
            {
                stream.setItem(key, entry.getValue());
            }
View Full Code Here

            string = string.replaceAll("^<<", "");
           
            if("".equals(string) || string.matches("^\\w$"))
                string = readWord().trim();
            while(!atEndOfDictionary) {
                COSName name = COSName.getPDFName(string);
                COSBase object = readObject();
                dictionary.setItem(name, object);

                byte singleByte = consumeWhitespace();
                if(singleByte == '>') {
View Full Code Here

        COSDictionary backwardsDictionary = new COSDictionary();
        // while we're not at the end of the dictionary, read in entries
        while(!atEndOfDictionary) {
            COSBase object = readObjectBackwards();
            COSName name = readNameBackwards();
            backwardsDictionary.setItem(name, object);
           
            singleByte = consumeWhitespaceBackwards();
            if(singleByte == '<') {
                inputFile.seek(currentOffset-1);
View Full Code Here

     * @throws IOException
     */
    private Raster createSoftMaskRaster(PDSoftMask softMask) throws IOException
    {
        TransparencyGroup transparencyGroup = new TransparencyGroup(softMask.getGroup());
        COSName subtype = softMask.getSubType();
        if (COSName.ALPHA.equals(subtype))
        {
            return transparencyGroup.getAlphaRaster();
        }
        else if (COSName.LUMINOSITY.equals(subtype))
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.cos.COSName

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.