Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSName


public class SetRenderingIntent extends OperatorProcessor
{
    @Override
    public void process(Operator operator, List<COSBase> operands) throws IOException
    {
        COSName value = (COSName)operands.get(0);
        context.getGraphicsState().setRenderingIntent(RenderingIntent.fromString(value.getName()));
    }
View Full Code Here


public class DrawObject extends OperatorProcessor
{
    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        COSName name = (COSName) arguments.get(0);
        PDXObject xobject =  context.getResources().getXObject(name);
        if (context instanceof PDFMarkedContentExtractor)
        {
            ((PDFMarkedContentExtractor) context).xobject(xobject);
        }
View Full Code Here

public class BeginMarkedContentSequence extends OperatorProcessor
{
    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        COSName tag = null;
        for (COSBase argument : arguments)
        {
            if (argument instanceof COSName)
            {
                tag = (COSName) argument;
View Full Code Here

public class BeginMarkedContentSequenceWithProperties extends OperatorProcessor
{
    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        COSName tag = null;
        COSDictionary properties = null;
        for (COSBase argument : arguments)
        {
            if (argument instanceof COSName)
            {
View Full Code Here

                        return obj;
                    }
                }
            else
            {
                COSName key = parseCOSName();
                COSBase value = parseCOSDictionaryValue();
                skipSpaces();
                if( ((char)pdfSource.peek()) == 'd' )
                {
                    //if the next string is 'def' then we are parsing a cmap stream
View Full Code Here

    private static final Log LOG = LogFactory.getLog(SetNonStrokingColorSpace.class);

    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        COSName name = (COSName)arguments.get(0);

        try
        {
            PDColorSpace cs = context.getResources().getColorSpace(name);
            context.getGraphicsState().setNonStrokingColorSpace(cs);
            context.getGraphicsState().setNonStrokingColor(cs.getInitialColor());
        }
        catch (PDColorSpace.MissingException e)
        {
            LOG.error("Missing color space: " + name.getName());
        }
    }
View Full Code Here

    private static final Log LOG = LogFactory.getLog(SetStrokingColorSpace.class);

    @Override
    public void process(Operator operator, List<COSBase> arguments) throws IOException
    {
        COSName name = (COSName)arguments.get(0);

        try
        {
            PDColorSpace cs = context.getResources().getColorSpace(name);
            context.getGraphicsState().setStrokingColorSpace(cs);
            context.getGraphicsState().setStrokingColor(cs.getInitialColor());
        }
        catch (PDColorSpace.MissingException e)
        {
            LOG.error("Missing color space: " + name.getName());
        }
    }
View Full Code Here

            array = new COSArray();
            js.setItem( COSName.DOC, array );
        }
        for( int i=0; i<array.size(); i++ )
        {
            COSName name = (COSName)array.get( i );
            i++;
            COSBase stream = array.get( i );
            PDNamedTextStream namedStream = new PDNamedTextStream( name, stream );
            namedStreams.add( namedStream );
        }
View Full Code Here

        COSBase encoding = dict.getDictionaryObject(COSName.ENCODING);
        if (encoding != null)
        {
            if (encoding instanceof COSName)
            {
                COSName encodingName = (COSName)encoding;
                this.encoding = Encoding.getInstance(encodingName);
                if (this.encoding == null)
                {
                    LOG.warn("Unknown encoding: " + encodingName.getName());
                    this.encoding = readEncodingFromFont(); // fallback
                }
            }
            else if (encoding instanceof COSDictionary)
            {
View Full Code Here

     * @return The name of the font.
     */
    public String getFontName()
    {
        String retval = null;
        COSName name = (COSName)dic.getDictionaryObject( COSName.FONT_NAME );
        if( name != null )
        {
            retval = name.getName();
        }
        return retval;
    }
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.