Hello,
I'm trying to create a pdf with formatted text with the following code:-
public void DownloadCommentaries(string[] sCommentaries, string sFileName)
{
Pdf pdf1 = null;
Section oSection = null;
Text oText = null;
for (int iCount = 0; iCount < sCommentaries.Length; iCount++)
{
//Instantiate Pdf object by calling its empty constructor
pdf1 = new Pdf();
pdf1.IsPageNumberForDocument = true;
oSection = pdf1.Sections.Add();
oText = new Text(sCommentaries[iCount]);
oText.Margin.Left = 0.1F;
oText.Margin.Bottom = 0.1F;
oText.Margin.Right = 0.1F;
oText.Margin.Left = 0.1F;
oText.IsHtmlTagSupported = true;
oSection.Paragraphs.Add(oText);
}
MemoryStream oMemoryStream = new MemoryStream();
pdf1.Save(oMemoryStream);
//open document
Aspose.Pdf.Facades.Form oPdfForm = new Aspose.Pdf.Facades.Form(oMemoryStream, sFileName);
//flatten fields
oPdfForm.FlattenAllFields();
//save output
oPdfForm.Save();
}
My sCommentary is attached. I get an error "Illegal characters in path". Please let me know the reason for the same asap because the intention to use Aspose to create pdf from formatted text is of utmost importance.
Regards,
Viswanathan