示例#1
0
 public static void AddIndent(Paragraph paragraph, StringBuilder style)
 {
     AddIndent(style, "text-indent", paragraph.GetFirstLineIndent());
     AddIndent(style, "start-indent", paragraph.GetIndentFromLeft());
     AddIndent(style, "end-indent", paragraph.GetIndentFromRight());
     AddIndent(style, "space-before", paragraph.GetSpacingBefore());
     AddIndent(style, "space-after", paragraph.GetSpacingAfter());
 }
示例#2
0
 public static void SetIndent(Paragraph paragraph, XmlElement block)
 {
     if (paragraph.GetFirstLineIndent() != 0)
     {
         block.SetAttribute(
                 "text-indent",
                 (paragraph.GetFirstLineIndent() / TWIPS_PER_PT).ToString() + "pt");
     }
     if (paragraph.GetIndentFromLeft() != 0)
     {
         block.SetAttribute(
                 "start-indent",
                 (paragraph.GetIndentFromLeft() / TWIPS_PER_PT).ToString() + "pt");
     }
     if (paragraph.GetIndentFromRight() != 0)
     {
         block.SetAttribute(
                 "end-indent",
                 (paragraph.GetIndentFromRight() / TWIPS_PER_PT).ToString() + "pt");
     }
     if (paragraph.GetSpacingBefore() != 0)
     {
         block.SetAttribute(
                 "space-before",
                 (paragraph.GetSpacingBefore() / TWIPS_PER_PT).ToString() + "pt");
     }
     if (paragraph.GetSpacingAfter() != 0)
     {
         block.SetAttribute("space-after",
                 (paragraph.GetSpacingAfter() / TWIPS_PER_PT) + "pt");
     }
 }