Free Support Forum - aspose.com

Dollar signs causing previous text on line to be removed

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

Hello Natalie,

Thanks for considering Aspose.

I have tested the scenario using Aspose.Pdf for .NET 4.3.0 and I am unable to notice any problem. The resultant PDF that I have generated is in attachment, please take a look.

In case you still face any problem while using the version 4.3.0 or you have any further query, please feel free to contact.

We apologize for your inconvenience.

Hi,

Ok that does work however I have managed to reproduce the situation that does not.

If you write a line "The cost of the spades are $100 each" then press return twice to get two blank lines and then type "This should remove the text before the line" so that you now have two lines in the paragraph this seems to cause it to break, you end up with just "100 each" and then the other line in the resulting PDF.

Can you please check this for me and see if it breaks for you.

Many Thanks

Natalie

Hello Natalie,

I have tested the scenario and I’m able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNET-17143. We will investigate this issue in details and will keep you updated on the status of a correction. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience.

Hi Nayyer,

Glad you were able to reproduce this.

Do we have any kind of time frame on this as I have several customers chasing me already to find out when this is going to be resolved?

If we could get a hotfix that would be terrific as this is quite a big issue for us.

Cheers

Natalie

Hello Natalie,

Before we have analyzed this issue in details, I am afraid it's pretty hard to share the timelines by which it will be resolved. Please spare us little time and once we have some updates, we would be pleased to update you with the status of correction.

Your patience and comprehension is greatly appreciated in this regard.

We apologize for your inconvenience.

Hi,

Can I please have some kind of idea when this is going to be resolved as this is a major issue for our clients, this was certainly working in previous versions of Aspose.pdf and I need to be able to give them some kind of indication of when this problem is likely to be resolved. In the mean time do you have any suggestions for a work around that we could put in our code that would allow this to work?

Thanks

Natalie

Hello Natalie,

Thanks for your patience.

I am pleased to inform you that the issue reported earlier has been resolved. We are busy with the testing of HotFix and once the activity is completed, we would be pleased to update you with the status of correction.

As a workaround, you can try using the following code lines to accomplish your requirements.

[C#]

String Symbol_String = "" + " The cost of the spades are $100 each
";
Text HTML_TextString = new Text(Symbol_String);
HTML_TextString.IsHtmlTagSupported = true;
objSec.Paragraphs.Add(HTML_TextString);

HTML_TextString.Segments.Add("his should remove the text before the line");

The resultant PDF that I have generated is in attachment, please take a look.

Please visit the following links for information on topics addressed in the above code snippet. HTML Tags in Text

In case you still face any problem or you have any further query, please feel free to contact.

We apologize for your inconvenience.

Hello Natalie,

I have discussed this matter with the development team and we expect to release the HotFix containing the resolution of this problem by the mid of this month (June-2010). Please be patient and spare us little time. We are sorry for your inconvenience.

The issues you have found earlier (filed as 17143) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.