/// <summary>
        /// Prepares this instance for rendering.
        /// </summary>
        public void PrepareDocument()
        {
            PdfFlattenVisitor visitor = new PdfFlattenVisitor();

            visitor.Visit(_document);
            _previousListNumbers = new Dictionary <ListType, int>(3);
            _previousListNumbers[ListType.NumberList1] = 0;
            _previousListNumbers[ListType.NumberList2] = 0;
            _previousListNumbers[ListType.NumberList3] = 0;
            _formattedDocument = new FormattedDocument(_document, this);
            //REM: Size should not be necessary in this case.
#if true
            XGraphics gfx = XGraphics.CreateMeasureContext(new XSize(2000, 2000), XGraphicsUnit.Point, XPageDirection.Downwards);
#else
#if GDI
            XGraphics gfx = XGraphics.FromGraphics(Graphics.FromHwnd(IntPtr.Zero), new XSize(2000, 2000));
#endif
#if WPF
            XGraphics gfx = XGraphics.FromDrawingContext(null, new XSize(2000, 2000), XGraphicsUnit.Point);
#endif
#endif
            //      _previousListNumber = int.MinValue;
            //gfx.MUH = _unicode;
            //gfx.MFEH = _fontEmbedding;

            _previousListInfo = null;
            _formattedDocument.Format(gfx);
        }
Example #2
0
        /// <summary>
        /// Prepares this instance for rendering.
        /// </summary>
        public void PrepareDocument()
        {
            PdfFlattenVisitor visitor = new PdfFlattenVisitor();

            visitor.Visit(this.document);
            this.previousListNumbers = new Hashtable(3);
            this.previousListNumbers[ListType.NumberList1] = 0;
            this.previousListNumbers[ListType.NumberList2] = 0;
            this.previousListNumbers[ListType.NumberList3] = 0;
            this.formattedDocument = new FormattedDocument(this.document, this);
            //REM: Size should not be necessary in this case.
            XGraphics gfx = XGraphics.CreateMeasureContext(new XSize(2000, 2000), XGraphicsUnit.Point, XPageDirection.Downwards);

            //      this.previousListNumber = int.MinValue;
            //gfx.MUH = this.unicode;
            //gfx.MFEH = this.fontEmbedding;

            this.previousListInfo = null;
            this.formattedDocument.Format(gfx);
        }