Exemplo n.º 1
0
        protected internal LayoutMasterSet(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:layout-master-set";
            this.simplePageMasters = new Hashtable();
            this.pageSequenceMasters = new Hashtable();

            if (parent.GetName().Equals("fo:root"))
            {
                this.root = (Root)parent;
                root.setLayoutMasterSet(this);
            }
            else
            {
                throw new FonetException("fo:layout-master-set must be child of fo:root, not "
                    + parent.GetName());
            }
            allRegions = new Hashtable();

        }
Exemplo n.º 2
0
        protected PageSequence(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:page-sequence";

            if (parent.GetName().Equals("fo:root"))
            {
                this.root = (Root)parent;
            }
            else
            {
                throw new FonetException("page-sequence must be child of root, not "
                    + parent.GetName());
            }

            layoutMasterSet = root.getLayoutMasterSet();
            layoutMasterSet.checkRegionNames();

            _flowMap = new Hashtable();

            thisIsFirstPage = true;
            ipnValue = this.properties.GetProperty("initial-page-number").GetString();

            if (ipnValue.Equals("auto"))
            {
                pageNumberType = AUTO;
            }
            else if (ipnValue.Equals("auto-even"))
            {
                pageNumberType = AUTO_EVEN;
            }
            else if (ipnValue.Equals("auto-odd"))
            {
                pageNumberType = AUTO_ODD;
            }
            else
            {
                pageNumberType = EXPLICIT;
                try
                {
                    int pageStart = Int32.Parse(ipnValue);
                    this.currentPageNumber = (pageStart > 0) ? pageStart - 1 : 0;
                }
                catch (FormatException)
                {
                    throw new FonetException("\"" + ipnValue
                        + "\" is not a valid value for initial-page-number");
                }
            }

            masterName = this.properties.GetProperty("master-reference").GetString();

            this.pageNumberGenerator =
                new PageNumberGenerator(this.properties.GetProperty("format").GetString(),
                                        this.properties.GetProperty("grouping-separator").GetCharacter(),
                                        this.properties.GetProperty("grouping-size").GetNumber().IntValue(),
                                        this.properties.GetProperty("letter-value").GetEnum());

            this.forcePageCount =
                this.properties.GetProperty("force-page-count").GetEnum();

        }