Пример #1
0
        public static void AddParagraphProperties(Paragraph paragraph, StringBuilder style)
        {
            AddIndent(paragraph, style);
            AddJustification(paragraph, style);

            AddBorder(paragraph.GetBottomBorder(), "bottom", style);
            AddBorder(paragraph.GetLeftBorder(), "left", style);
            AddBorder(paragraph.GetRightBorder(), "right", style);
            AddBorder(paragraph.GetTopBorder(), "top", style);

            if (paragraph.PageBreakBefore())
            {
                style.Append("break-before:page;");
            }

            style.Append("hyphenate:" + (paragraph.IsAutoHyphenated ? "auto" : "none") + ";");

            if (paragraph.KeepOnPage())
            {
                style.Append("keep-together.within-page:always;");
            }

            if (paragraph.KeepWithNext())
            {
                style.Append("keep-with-next.within-page:always;");
            }
        }
Пример #2
0
        public static void SetParagraphProperties(Paragraph paragraph, XmlElement block)
        {
            SetIndent(paragraph, block);
            SetJustification(paragraph, block);

            SetBorder(block, paragraph.GetBottomBorder(), "bottom");
            SetBorder(block, paragraph.GetLeftBorder(), "left");
            SetBorder(block, paragraph.GetRightBorder(), "right");
            SetBorder(block, paragraph.GetTopBorder(), "top");

            if (paragraph.PageBreakBefore())
            {
                block.SetAttribute("break-before", "page");
            }

            block.SetAttribute("hyphenate", paragraph.IsAutoHyphenated.ToString());

            if (paragraph.KeepOnPage())
            {
                block.SetAttribute("keep-together.within-page", "always");
            }

            if (paragraph.KeepWithNext())
            {
                block.SetAttribute("keep-with-next.within-page", "always");
            }

            block.SetAttribute("linefeed-treatment", "preserve");
            block.SetAttribute("white-space-collapse", "false");
        }