Examples of EncodingManager


Examples of com.volantis.charset.EncodingManager

     */
    protected NamedProtocolBuilder protocolBuilder;

    /** Creates a new instance of DefaultApplicationContextFactory */
    public MPSApplicationContextFactory() {
        this.encodingManager = new EncodingManager();

        protocolBuilder = new NamedProtocolBuilder();
        // Register the known protocols with the builder.
        ProtocolRegistry registry = new ProtocolRegistry();
        registry.register(protocolBuilder);
View Full Code Here

Examples of com.volantis.charset.EncodingManager

                context.pushRequestContext(this);
            }


            // Select the best charset that we could find from the accept headers.
            EncodingManager encodingManager = appContext.getEncodingManager();
            AcceptCharsetSelector selector = new AcceptCharsetSelector(
                    encodingManager);
            HttpHeaders rHeaders = HttpFactory.getDefaultInstance()
                    .createHTTPHeaders();
            String charset = selector.selectCharset(rHeaders,
View Full Code Here

Examples of com.volantis.charset.EncodingManager

                context.pushRequestContext(this);
            }


            // Select the best charset that we could find from the accept headers.
            EncodingManager encodingManager = appContext.getEncodingManager();
            AcceptCharsetSelector selector = new AcceptCharsetSelector(
                    encodingManager);
            HttpHeaders rHeaders = HttpServletFactory.
                    getDefaultInstance().getHTTPHeaders(request);
            String charset = selector.selectCharset(rHeaders,
View Full Code Here

Examples of com.volantis.charset.EncodingManager

        TestMarinerRequestContext requestContext =
                new TestMarinerRequestContext();

        final ApplicationContext appContext =
                new ApplicationContext(requestContext);
        appContext.setEncodingManager(new EncodingManager());

        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        pageContext.pushRequestContext(requestContext);

        final PolicyReferenceResolverMock referenceResolverMock =
View Full Code Here

Examples of com.volantis.charset.EncodingManager

    /**
     * Initializes this factory.
     */
    public PrerendererApplicationContextFactory() {
        this.encodingManager = new EncodingManager();

        protocolBuilder = new NamedProtocolBuilder();
       
        ProtocolRegistry registry = new ProtocolRegistry();
       
View Full Code Here

Examples of com.volantis.charset.EncodingManager

     */
    protected NamedProtocolBuilder protocolBuilder;

    public DefaultApplicationContextFactory() {
        // This may be slow if we have to preload BitSetEncoding charsets.
        this.encodingManager = new EncodingManager();

        protocolBuilder = new NamedProtocolBuilder();
        // Register the known protocols with the builder.
        ProtocolRegistry registry = new ProtocolRegistry();
        registry.register(protocolBuilder);
View Full Code Here

Examples of com.volantis.charset.EncodingManager

        applicationContext.setProtocol(protocol);
        applicationContext.setDissectionSupported(true);
        applicationContext.setFragmentationSupported(true);
        applicationContext.setCanvasTagSupported(true);
        applicationContext.setWMLCSupported(false);
        applicationContext.setEncodingManager(new EncodingManager());
        applicationContext.setPackager(new DefaultPackager());

        TestVolantis volantisBean = new TestVolantis();

        RuntimeDeviceTheme runtimeDeviceTheme = createRuntimeDeviceTheme();
View Full Code Here

Examples of org.apache.pdfbox.encoding.EncodingManager

     */
    public Encoding getEncoding() throws IOException
    {
        if( fontEncoding == null )
        {
            EncodingManager manager = getEncodingManager();
            COSBase encoding = getEncodingObject(); //font.getDictionaryObject( COSName.ENCODING );
            if( encoding == null )
            {
                FontMetric metric = getAFM();
                if( metric != null )
                {
                    fontEncoding = new AFMEncoding( metric );
                }
                if( fontEncoding == null )
                {
                    fontEncoding = manager.getStandardEncoding();
                }
            }
            /**
             * Si la cl� /Encoding existe dans le dictionnaire fonte il y a deux possibilit�s :
             * 1er cas : elle est associ� � une reference contenant un dictionnaire de type encoding.
             * Ce dictionnaire PDF est repr�sent� par un DictionaryEncoding.
             * If the /Encoding Key does exist in the font dictionary, there are two cases :
             * case one : The value associated with /Encoding is a reference to a dictionary.
             * This dictionary is represented by an instance of DictionaryEncoding class
             */
            else if( encoding instanceof COSDictionary )
            {
                COSDictionary encodingDic = (COSDictionary)encoding;
                //Let's see if the encoding dictionary has a base encoding
                //If it does not then we will attempt to get it from the font
                //file
                COSName baseEncodingName = (COSName) encodingDic.getDictionaryObject(
                    COSName.BASE_ENCODING);
                //on ajoute une entr�e /BaseEncoding dans /Encoding uniquement si elle en est absente
                //if not find in Encoding dictinary target, we try to find it from else where
                if( baseEncodingName == null)
                {
                    COSName fontEncodingFromFile = getEncodingFromFont();
                    encodingDic.setItem(
                        COSName.BASE_ENCODING,
                        fontEncodingFromFile );
                }
                fontEncoding = new DictionaryEncoding( encodingDic );
            }
            else if( encoding instanceof COSName )
            {
                if( !encoding.equals( COSName.IDENTITY_H ) )
                {
                    fontEncoding = manager.getEncoding( (COSName)encoding );
                }
            }
            else
            {
                throw new IOException( "Unexpected encoding type:" + encoding.getClass().getName() );
View Full Code Here

Examples of org.apache.pdfbox.encoding.EncodingManager

   
    private static EncodingManager encodingManager = null;
   
    protected static EncodingManager getEncodingManager(){
        if(encodingManager == null){
            encodingManager = new EncodingManager();
        }
        return encodingManager;
    }
View Full Code Here

Examples of org.apache.pdfbox.encoding.EncodingManager

    }

    private Map<Integer,String> loadEncoding(COSName name) throws IOException
    {
        Map<Integer,String> result = new LinkedHashMap<Integer,String>();
        EncodingManager encodingManager = new EncodingManager();
        Encoding encoding = encodingManager.getEncoding(name);
        for( Iterator<Map.Entry<Integer,COSName>> it = (encoding.getCodeToNameMap().entrySet()).iterator();
                    it.hasNext();)
        {
            Map.Entry<Integer,COSName> entry = it.next();
            result.put(entry.getKey(), (entry.getValue()).getName());
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.