Example #1
0
        /// <summary>
        /// Private method for the initialization of all PDF objects
        /// </summary>
        private void initializeObjects()
        {
            int counterID = 0;

            //header
            _header = new pdfHeader();
            _header.objectIDHeader   = 1;
            _header.objectIDInfo     = 2;
            _header.objectIDOutlines = 3;
            //Info
            _info = new pdfInfo(_title, _author);
            _info.objectIDInfo = 2;
            //Outlines
            _outlines = new pdfOutlines();
            _outlines.objectIDOutlines = 3;
            counterID = 4;
            //fonst
            for (int i = 0; i < 12; i++)
            {
                _fonts.Add(new pdfFont((predefinedFont)(i + 1), i + 1));
                ((pdfFont)_fonts[i]).objectID = counterID;
                counterID++;
            }
            //pagetree
            _pageTree          = new pdfPageTree();
            _pageTree.objectID = counterID;
            _header.pageTreeID = counterID;
            counterID++;
            //pages
            foreach (pdfPage page in _pages)
            {
                page.objectID   = counterID;
                page.pageTreeID = _pageTree.objectID;
                page.addFonts(_fonts);
                _pageTree.addPage(counterID);
                counterID++;
                //page's elements
                foreach (pdfElement element in page.elements)
                {
                    element.objectID = counterID;
                    counterID++;
                    //Imageobject
                    if (element.GetType().Name == "imageElement")
                    {
                        ((imageElement)element).xObjectID = counterID;
                        counterID++;
                    }
                }
            }
            //trailer
            _trailer = new pdfTrailer(counterID - 1);
        }
Example #2
0
        /// <summary>
        /// Private method for the initialization of all PDF objects
        /// </summary>
        private void initializeObjects()
        {
            //Page's counters
            int pageIndex = 1;
            int pageNum   = _pages.Count;

            int counterID = 0;

            //header
            _header = new pdfHeader(_openBookmark);
            _header.objectIDHeader   = 1;
            _header.objectIDInfo     = 2;
            _header.objectIDOutlines = 3;
            //Info
            _info = new pdfInfo(_title, _author);
            _info.objectIDInfo = 2;
            //Outlines
            _outlines.objectIDOutlines = 3;
            counterID = 4;
            //Bookmarks
            counterID = _outlines.initializeOutlines(counterID);
            //fonts
            for (int i = 0; i < 12; i++)
            {
                _fonts.Add(new pdfFont((predefinedFont)(i + 1), i + 1));
                ((pdfFont)_fonts[i]).objectID = counterID;
                counterID++;
            }
            //pagetree
            _pageTree          = new pdfPageTree();
            _pageTree.objectID = counterID;
            _header.pageTreeID = counterID;
            counterID++;
            //pages
            foreach (pdfPage page in _pages)
            {
                page.objectID   = counterID;
                page.pageTreeID = _pageTree.objectID;
                page.addFonts(_fonts);
                _pageTree.addPage(counterID);
                counterID++;

                //Add page's Marker
                if (_pageMarker != null)
                {
                    page.addText(_pageMarker.getMarker(pageIndex, pageNum), _pageMarker.coordX, _pageMarker.coordY, _pageMarker.fontType, _pageMarker.fontSize, _pageMarker.fontColor);
                }

                //Add persistent elements
                if (_persistentPage != null)
                {
                    page.elements.AddRange(_persistentPage.persistentElements);
                }

                //page's elements
                foreach (pdfElement element in page.elements)
                {
                    element.objectID = counterID;
                    counterID++;
                    //Imageobject
                    if (element.GetType().Name == "imageElement")
                    {
                        ((imageElement)element).xObjectID = counterID;
                        counterID++;
                    }
                }

                //Update page's index counter
                pageIndex += 1;
            }
            //trailer
            _trailer = new pdfTrailer(counterID - 1);
        }
Example #3
0
 /// <summary>
 /// Private method for the initialization of all PDF objects
 /// </summary>
 private void initializeObjects()
 {
     int counterID = 0;
     //header
     _header = new pdfHeader();
     _header.objectIDHeader = 1;
     _header.objectIDInfo = 2;
     _header.objectIDOutlines = 3;
     //Info
     _info = new pdfInfo(_title, _author);
     _info.objectIDInfo = 2;
     //Outlines
     _outlines = new pdfOutlines();
     _outlines.objectIDOutlines = 3;
     counterID = 4;
     //fonst
     for (int i= 0; i < 12; i++)
     {
         _fonts.Add(new pdfFont((predefinedFont)(i + 1), i + 1));
         ((pdfFont)_fonts[i]).objectID = counterID;
         counterID++;
     }
     //pagetree
     _pageTree = new pdfPageTree();
     _pageTree.objectID = counterID;
     _header.pageTreeID = counterID;
     counterID++;
     //pages
     foreach(pdfPage page in _pages)
     {
         page.objectID = counterID;
         page.pageTreeID = _pageTree.objectID;
         page.addFonts(_fonts);
         _pageTree.addPage(counterID);
         counterID++;
         //page's elements
         foreach (pdfElement element in page.elements)
         {
             element.objectID = counterID;
             counterID++;
             //Imageobject
             if (element.GetType().Name == "imageElement")
             {
                 ((imageElement)element).xObjectID = counterID;
                 counterID++;
             }
         }
     }
     //trailer
     _trailer = new pdfTrailer(counterID - 1);
 }
        /// <summary>
        /// Private method for the initialization of all PDF objects
        /// </summary>
        private void initializeObjects()
        {
            //Page's counters
            int	pageIndex = 1;
            int	pageNum = _pages.Count;

            int counterID = 0;
            //header
            _header = new pdfHeader(_openBookmark);
            _header.objectIDHeader = 1;
            _header.objectIDInfo = 2;
            _header.objectIDOutlines = 3;
            //Info
            _info = new pdfInfo(_title, _author);
            _info.objectIDInfo = 2;
            //Outlines
            _outlines.objectIDOutlines = 3;
            counterID = 4;
            //Bookmarks
            counterID = _outlines.initializeOutlines(counterID);
            //fonts
            for (int i= 0; i < 12; i++)
            {
                _fonts.Add(new pdfFont((predefinedFont)(i + 1), i + 1));
                ((pdfFont)_fonts[i]).objectID = counterID;
                counterID++;
            }
            //pagetree
            _pageTree = new pdfPageTree();
            _pageTree.objectID = counterID;
            _header.pageTreeID = counterID;
            counterID++;
            //pages
            foreach(pdfPage page in _pages)
            {
                page.objectID = counterID;
                page.pageTreeID = _pageTree.objectID;
                page.addFonts(_fonts);
                _pageTree.addPage(counterID);
                counterID++;

                //Add page's Marker
                if (_pageMarker != null) {
                    page.addText(_pageMarker.getMarker(pageIndex, pageNum),_pageMarker.coordX, _pageMarker.coordY,_pageMarker.fontType, _pageMarker.fontSize, _pageMarker.fontColor);
                }

                //Add persistent elements
                if (_persistentPage != null) {
                    page.elements.AddRange(_persistentPage.persistentElements);
                }

                //page's elements
                foreach (pdfElement element in page.elements)
                {
                    element.objectID = counterID;
                    counterID++;
                    //Imageobject
                    if (element.GetType().Name == "imageElement")
                    {
                        ((imageElement)element).xObjectID = counterID;
                        counterID++;
                    }
                }

                //Update page's index counter
                pageIndex += 1;
            }
            //trailer
            _trailer = new pdfTrailer(counterID - 1);
        }