Esempio n. 1
0
        private void DoIndentedText(string text, string heading)
        {
            if (text.Length > 0)
            {
                text = HandleText(text);

                GuideFrame left = LeftHeader(heading);

                GuideFrame right       = GetTextFrame(Mode.SingleColumn, FrameType.Text, true);
                Bounds     rightBounds = right.bounds;

                rightBounds.top   = left.bounds.top + 1;
                rightBounds.left += INDENTED + 1;
                right.ApplyBounds();
                right.AddPara(text, "text", true);

                right.ResizeToFit();

                if (right.OverflowsPage())
                {
                    if (right.page.contentBounds.bottom - right.bounds.top > 20)
                    {
                        GuidePage newPage = this.GetNextPage(right.page, true);

                        GuideFrame newFrame = right.SplitFrame(newPage);

                        newFrame.bounds.left = newFrame.page.contentBounds.left + INDENTED + 2;
                        //newFrame.TransformBoundsForNewPage(newPage);
                        newFrame.bounds.top = right.page.contentBounds.top;
                        newFrame.ApplyBounds();
                        newFrame.ResizeToFit();
                    }
                    else
                    {
                        //MoveFrameToNext(left, leftBounds, false);
                        left.MoveFrameToNext(false);

                        right.MoveToPage(currentPage);
                        right.bounds.top = left.bounds.top + 1;
                        right.ApplyBounds();
                        right.ResizeToFit();
                    }
                }
                else
                {
                    currentPage.nextTopMin = Math.Max(left.bounds.bottom + left.bottomOffset, right.bounds.bottom + left.bottomOffset);
                }
            }
        }
Esempio n. 2
0
        private double DoHeaderIcon(double iconTop, string icon, string text)
        {
            if (text.Length > 0)
            {
                string iconPath   = GetIconPath(icon);
                Bounds iconBounds = new Bounds();
                iconBounds.top  = iconTop;
                iconBounds.left = currentPage.contentBounds.left + GRAPHSIZE + 2;
                double iconSize = ICONSIZE;
                iconBounds.width  = iconSize;
                iconBounds.height = iconSize;

                //PlaceImageInRect(iconPath, iconBounds, true, idPDFCrop.idCropContent);
                PlaceImageInRect(iconPath, iconBounds, true, idPDFCrop.idCropContentAllLayers);

                GuideFrame right       = GetTextFrame(Mode.SingleColumn, FrameType.Text, true);
                Bounds     rightBounds = right.bounds;
                rightBounds.top  = iconTop + 1;
                rightBounds.left = iconBounds.left + iconSize + 2;
                right.ApplyBounds();
                right.AddPara(text, "text", true);

                right.ResizeToFit();

                iconTop += Math.Max(iconSize, right.bounds.height) + 1;
            }
            return(iconTop);
        }
Esempio n. 3
0
        private GuideFrame LeftHeader(string heading)
        {
            GuideFrame left = GetTextFrame(Mode.SingleColumn, FrameType.IndentedHeader, true);

            left.AddPara(heading, "indentedHeader", false);
            left.bounds.width = INDENTED;
            left.ApplyBounds();
            left.ResizeToFit();
            return(left);
        }
Esempio n. 4
0
        public GuideFrame SplitFrame(GuidePage newPage)
        {
            GuideFrame newFrame = newPage.CreateTextFrame(this.mode, this.type);

            // thread the current frame to the next, and set it to the end of page
            textFrame.NextTextFrame   = newFrame.textFrame;
            bounds.bottom             = page.contentBounds.bottom;
            textFrame.GeometricBounds = bounds.raw;

            // size the new frame

            //Bounds newBounds = newFrame.bounds;
            newFrame.ResizeToFit();

            //currentPage.currentY = newBounds.bottom;

            return(newFrame);
        }