I am running into multiple bugs while creating a fairly simple pdf. Some of these (the ones I wrote down before giving up) are
1. TextInfo.AlignmentType doesn’t work with html segments; current workaround is to create a table tag (no idea what to do about justify text, fortunately I am not using any) [1]
static Text GetTitle(Section section, string title) {
var text = new Text(section);
text.TextInfo.Alignment = AlignmentType.Center;
text.TextInfo.FontSize = 12;
text.IsHtmlTagSupported = true;
var segment = text.Segments.Add();
segment.Content = string.Format("
{0} |
return text;
}
2. css text-align doesn’t appear to do anything
3. html tag does nothing ( the only way I am able to center text is with the table tag above)
4. css margin-left and padding-left appear to do nothing (how can I indent text?); the only method of indentation I have discovered is:
string.Format("
{0} |
5. successive
tags do not provide multiple line breaks[1]
6. doesn’t provide a non-breaking space[1]
7. Section.InsertFooter() doesn’t insert a footer; appears to insert a regular paragraph; code snippets:
var pdf = new Pdf();
InjectLicense();
pdf.DefaultFontName = “Arial”;
var section = pdf.Sections.Add();
section.TextInfo.FontName = “Arial”;
section.Paragraphs.Add(GetPdfHeader(section));
var pagefooter = section.InsertFooter(HeaderFooterType.Both);
pagefooter.Paragraphs.Add(GetPageFooter(section));
…
Text GetPageFooter(Section section) {
var text = new Text(section);
text.TextInfo.Alignment = AlignmentType.FullJustify;
text.TextInfo.FontSize = 10;
text.IsHtmlTagSupported = true;
var segment = text.Segments.Add();
segment.Content = _footer;
return text;
}
[1]: these are regressions that were properly working in at least 4.1 (the previous version of this library I used)