public string GetParagraphStyleAsHtml(ParagraphStyle paragraphStyle)
{
string style = "style=\"";
try
{
if (paragraphStyle != null)
{
if (paragraphStyle.ParagraphProperties != null)
{
if (paragraphStyle.ParagraphProperties.Alignment != null
&& paragraphStyle.ParagraphProperties.Alignment != "start")
style += "text-align: "+paragraphStyle.ParagraphProperties.Alignment+"; ";
if (paragraphStyle.ParagraphProperties.MarginLeft != null)
style += "text-indent: "+paragraphStyle.ParagraphProperties.MarginLeft+"; ";
if (paragraphStyle.ParagraphProperties.LineSpacing != null)
style += "line-height: "+paragraphStyle.ParagraphProperties.LineSpacing+"; ";
if (paragraphStyle.ParagraphProperties.Border != null
&& paragraphStyle.ParagraphProperties.Padding == null)
style += "border-width:1px; border-style:solid; padding: 0.5cm; ";
if (paragraphStyle.ParagraphProperties.Border != null
&& paragraphStyle.ParagraphProperties.Padding != null)
style += "border-width:1px; border-style:solid; padding:"+paragraphStyle.ParagraphProperties.Padding+"; ";
if (paragraphStyle.ParagraphProperties.BackgroundColor != null)
style += "background-color: "+paragraphStyle.ParagraphProperties.BackgroundColor+"; ";
}
}
}
catch(Exception ex)
{
throw new AODLException("Exception while trying to build a HTML style string from a ParagraphStyle.", ex);
}
if (!style.EndsWith("; "))
style = "";
else
style += "\"";
return style;
}