@pshea
Thanks for contacting support.
I have tested the scenario using your code snippet and noticed that the method (StringUtils_repeat(string v1, int v2)
) caused the System.OutOfMemoryException Exception. The reason is that, you were using quite basic way to concatenate two string using plus (+) sign, which consumes a lot of memory and in case if string length exceeds than 1000, it causes exception.
In order to concatenate long length string, the recommended way is using StringBuilder
. Please check following modified method which I have used to generate long HTML string and generated document in our environment. For your reference, I have also attached an output, generated over our end.
private static string StringUtils_repeat(string v1, int v2)
{
StringBuilder sb = new StringBuilder();
int i = 1;
while (i < v2)
{
sb.Append(v1);
i++;
}
return sb.ToString();
}
Output : fontbreak.pdf (582.1 KB)
Please use above method to generate long length HTML string and in case if you still face any issue, please let us know. We will again test the scenario in our environment and address it accordingly.
Best Regards,
Asad Ali