/// <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() { 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); }