public void Init(CreateAndRegisterStream createAndRegisterStream, AutoFit autoFit, string reportName) { m_outStream = createAndRegisterStream(reportName, "doc", null, "application/msword", willSeek: false, StreamOper.CreateAndRegister); m_tableStream = createAndRegisterStream("TableStream", null, null, null, willSeek: true, StreamOper.CreateOnly); m_mainStream = createAndRegisterStream("WordDocument", null, null, null, willSeek: true, StreamOper.CreateOnly); m_fontTable = createAndRegisterStream("FontTable", null, null, null, willSeek: true, StreamOper.CreateOnly); m_dataStream = createAndRegisterStream("Data", null, null, null, willSeek: true, StreamOper.CreateOnly); m_listStream = createAndRegisterStream("List", null, null, null, willSeek: true, StreamOper.CreateOnly); m_listLevelStream = createAndRegisterStream("ListLevel", null, null, null, willSeek: true, StreamOper.CreateOnly); Stream textPiece = createAndRegisterStream("TextPiece", null, null, null, willSeek: true, StreamOper.CreateOnly); Stream chpTable = createAndRegisterStream("ChpTable", null, null, null, willSeek: true, StreamOper.CreateOnly); Stream papTable = createAndRegisterStream("PapTable", null, null, null, willSeek: true, StreamOper.CreateOnly); m_charFormat = new CharacterFormat(chpTable, m_fcStart); m_parFormat = new ParagraphFormat(papTable, m_fcStart); m_wordText = new WordText(textPiece); m_secFormat = new SectionFormat(); m_currentRow = new TableData(1, layoutTable: true); m_tapStack = new Stack <TableData>(); m_fontNameSet = new Dictionary <string, int>(); WriteFont("Times New Roman"); WriteFont("Symbol"); WriteFont("Arial"); m_imgIndex = 0; m_fldsMain = new FieldsTable(); m_fldsHdr = new FieldsTable(); m_fldsCurrent = m_fldsMain; m_bookmarks = new Bookmarks(); m_images = new Dictionary <ImageHash, int>(); m_autoFit = autoFit; }
public void InitHeaderFooter() { m_ccpText = m_wordText.CurrentCp; m_headerFooterOffsets = new int[14 + 6 * m_secFormat.SectionCount]; m_fldsCurrent = m_fldsHdr; }