Ejemplo n.º 1
0
 /// <summary>
 /// Instantiates a new
 /// <see cref="ProcessorContext"/>
 /// instance.
 /// </summary>
 /// <param name="converterProperties">
 /// a
 /// <see cref="iText.Html2pdf.ConverterProperties"/>
 /// instance
 /// </param>
 public ProcessorContext(ConverterProperties converterProperties)
 {
     if (converterProperties == null)
     {
         converterProperties = new ConverterProperties();
     }
     state             = new State();
     deviceDescription = converterProperties.GetMediaDeviceDescription();
     if (deviceDescription == null)
     {
         deviceDescription = MediaDeviceDescription.GetDefault();
     }
     fontProvider = converterProperties.GetFontProvider();
     if (fontProvider == null)
     {
         fontProvider = new DefaultFontProvider();
     }
     tagWorkerFactory = converterProperties.GetTagWorkerFactory();
     if (tagWorkerFactory == null)
     {
         tagWorkerFactory = DefaultTagWorkerFactory.GetInstance();
     }
     cssApplierFactory = converterProperties.GetCssApplierFactory();
     if (cssApplierFactory == null)
     {
         cssApplierFactory = DefaultCssApplierFactory.GetInstance();
     }
     baseUri = converterProperties.GetBaseUri();
     if (baseUri == null)
     {
         baseUri = "";
     }
     outlineHandler = converterProperties.GetOutlineHandler();
     if (outlineHandler == null)
     {
         outlineHandler = new OutlineHandler();
     }
     resourceResolver      = new HtmlResourceResolver(baseUri, this, converterProperties.GetResourceRetriever());
     limitOfLayouts        = converterProperties.GetLimitOfLayouts();
     cssContext            = new CssContext();
     linkContext           = new LinkContext();
     createAcroForm        = converterProperties.IsCreateAcroForm();
     formFieldNameResolver = new FormFieldNameResolver();
     radioCheckResolver    = new RadioCheckResolver();
     immediateFlush        = converterProperties.IsImmediateFlush();
     metaInfo            = converterProperties.GetEventCountingMetaInfo();
     processingInlineSvg = false;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Instantiates a new
        /// <see cref="SvgProcessorContext"/>
        /// instance.
        /// </summary>
        /// <param name="converterProperties">
        /// a
        /// <see cref="iText.Svg.Processors.ISvgConverterProperties"/>
        /// instance
        /// </param>
        public SvgProcessorContext(ISvgConverterProperties converterProperties)
        {
            deviceDescription = converterProperties.GetMediaDeviceDescription();
            if (deviceDescription == null)
            {
                deviceDescription = MediaDeviceDescription.GetDefault();
            }
            fontProvider = converterProperties.GetFontProvider();
            if (fontProvider == null)
            {
                fontProvider = new BasicFontProvider();
            }
            String baseUri = converterProperties.GetBaseUri();

            if (baseUri == null)
            {
                baseUri = "";
            }
            resourceResolver = new ResourceResolver(baseUri);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Instantiates a new
        /// <see cref="SvgProcessorContext"/>
        /// instance.
        /// </summary>
        /// <param name="converterProperties">
        /// a
        /// <see cref="iText.Svg.Processors.ISvgConverterProperties"/>
        /// instance
        /// </param>
        public SvgProcessorContext(ISvgConverterProperties converterProperties)
        {
            deviceDescription = converterProperties.GetMediaDeviceDescription();
            if (deviceDescription == null)
            {
                deviceDescription = MediaDeviceDescription.GetDefault();
            }
            fontProvider = converterProperties.GetFontProvider();
            if (fontProvider == null)
            {
                fontProvider = new BasicFontProvider();
            }
            IResourceRetriever retriever = null;

            // TODO DEVSIX-3814 change the clause if block to retriever = new ResourceResolver(props.getBaseUri(),
            //  converterProperties.getResourceRetriever()) when the ISvgConverterProperties#getResourceRetriever() is added
            if (converterProperties is SvgConverterProperties)
            {
                retriever = ((SvgConverterProperties)converterProperties).GetResourceRetriever();
            }
            resourceResolver = new ResourceResolver(converterProperties.GetBaseUri(), retriever);
        }