Exemple #1
0
            public ResourceBuilder <T> AddSimpeType1Font(string baseFont, out FontIdentifier identifier)
            {
                string name = "F" + _parent.Compositor.FontID.ToString();

                identifier = new FontIdentifier {
                    Name = name
                };

                IndirectObject reference = _parent.Compositor.IndirectObject(
                    _parent.Compositor.Dictionary("Font")
                    .Set("Subtype", new NameObject("Type1"))
                    .Set("BaseFont", new NameObject(baseFont))
                    );

                if (_fonts == null)
                {
                    _fonts = new DictionaryObject();
                    _me.Set("Font", _fonts);
                }

                _fonts.Set(name, reference);
                _parent.Compositor.FontID += 1;

                return(this);
            }
Exemple #2
0
        private Compositor(int generation, int startingID)
        {
            _generation = generation;
            _startID    = _id = startingID;

            _catalogReference = IndirectObject(_catalog = Dictionary("Catalog"));
            _rootCollection   = new PageCollectionBuilder(this);
            _catalog.Set("Pages", _rootCollection.Reference);

            FontID = 1;
        }
Exemple #3
0
            public PageBuilder(PageCollectionBuilder parent)
            {
                _parent = parent;

                IndirectObject pageRef = _parent.Compositor.IndirectObject(
                    _dictionary = parent.Compositor.Dictionary("Page")
                                  .Set("Parent", parent.Reference)
                    );

                parent.Kids.Add(pageRef);

                _dictionary.Set("Contents", parent.Compositor.StreamObject(_stream = new TextCommandStream()));
            }