Hi,
I have a problem exactly the same as reported in another thread which was logged as PDFNET-13425. except in that issue the dollar signs in a table were causing any text prior to that on the line to be removed. I am having exactly the same issue however it is happening for me when converting the body from an email into a pdf. The code highlighted in red is where I am putting the body of the email into a Paragraph and it is here that it is losing text.
For example if I had "The cost of the spades are $100 each" in the text then on the pdf conversion I would only see "$100 each" in the pdf produced.
private Byte[] PDFByteArray(e5Email email) {<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Aspose.Pdf.Pdf objPDF = new Aspose.Pdf.Pdf();
Aspose.Pdf.Section objSec = objPDF.Sections.Add();
objSec.Paragraphs.Add(new Aspose.Pdf.Text("date:\t\t" + email.date.ToLongDateString() + " " + email.date.ToShortTimeString()));
objSec.Paragraphs.Add(new Aspose.Pdf.Text("from:\t\t" + email.from));
objSec.Paragraphs.Add(new Aspose.Pdf.Text("to:\t\t" + email.to));
objSec.Paragraphs.Add(new Aspose.Pdf.Text("cc:\t\t" + email.cc));
objSec.Paragraphs.Add(new Aspose.Pdf.Text("subject:\t" + email.subject));
objSec.Paragraphs.Add(new Aspose.Pdf.Text(" "));
Aspose.Pdf.Graph graph1 = new Aspose.Pdf.Graph(objSec);
objSec.Paragraphs.Add(graph1);
float[] posArr = new float[] { 0, 0, 300, 0 };
Aspose.Pdf.Line l1 = new Aspose.Pdf.Line(graph1, posArr);
l1.GraphInfo.Color = new Aspose.Pdf.Color("Red");
l1.GraphInfo.LineWidth = 1;
l1.GraphInfo.LineCapMode = 1;
graph1.Shapes.Add(l1);
objSec.Paragraphs.Add(new Aspose.Pdf.Text(" "));
//check for body text
if (!string.IsNullOrEmpty(email.body.Text.Trim())) {
objSec.Paragraphs.Add(
new Aspose.Pdf.Text(email.body.Text.Trim()));
}
foreach (e5EmailAttachment attachment in email.Attachments) {
addPdfAttachment(ref objSec, attachment);
}
using (MemoryStream myPDFStream = new MemoryStream())
{
objPDF.Save(myPDFStream);
return myPDFStream.ToArray();
}
}
Please let me know if this is an issue and if it is can it please be fixed as quickly as possible as this is causing issues for our users.
Kind regards
Natalie