When I have some text with no html formatting the displayed text is fine, as below:
Could you save as much as the Jones family? By following the advice of Which? over the last 6 months, the Jones family saved over £545#. We’re confident we could help you save too.
But when I apply some html formatting (eg, ) the text then loses all its original styling, as below:
Could you save as much as the Jones family? By following the advice of Which? over the last 6 months, the Jones family saved over £545#. We’re confident we could help you save too.
<Segment><b>Could you</b> save as much as the Jones family? By following the advice of Which? over the last 6 months, the Jones family saved over œ545#. We’re confident we could help you save too. <font size="7"> #After switching energy providers, they’re paying œ150 less on their annual bill. They saved over œ60 by opting for a Best Buy loan to buy a car – and are earning an extra œ270 on their savings with a Best Buy ISA. What’s more, their new energy efficient tumble dryer will cut their electricity bills by œ65 a year.</font></Segment>
I have tested the issue and I am unable to reproduce the problem. Please make sure you are using latest version of Aspose.pdf. The resultant file that I have generated is in attachment.
The problem is that I want to use 'Proxima Nova' font which is specified in the xml text tag. If I put no html formatting in the text, everything looks OK. But when I add just one html tag to the paragraph all text after the tag defaults to Times New Roman!
Would it be that if I put a single HTML tag in the paragraph, all other xml based formatting tags are lost, eg font name, size etc. and these have to be specified explicitly in the paragraph text as HTML tags instead? Please advise.
para05 text (from database): Could you save as much as the Jones family? By following the advice of Which? over the last 6 months, the Jones family saved over £545#. We’re confident we could help you save too. #After switching energy providers, they’re paying £150 less on their annual bill. They saved over £60 by opting for a Best Buy loan to buy a car – and are earning an extra £270 on their savings with a Best Buy ISA. What’s more, their new energy efficient tumble dryer will cut their electricity bills by £65 a year.
Output pdf:
Could you save as much as the Jones family? By following the advice of Which? over the last 6 months, the Jones family saved over £545#. We’re confident we could help you save too. #After switching energy providers, they’re paying £150 less on their annual bill. They saved over £60 by opting for a Best Buy loan to buy a car – and are earning an extra £270 on their savings with a Best Buy ISA. What’s more, their new energy efficient tumble dryer will cut their electricity bills by £65 a year.
As you can see, all is good until the tag, when the font defaults to Times and the size to 14 (?). Font then continues till the size is changed but the font family continues!
I have tested the issue and I’m able to reproduce the same problem. I have logged it in our issue tracking system as PDFNET-5942. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
We have tested the cases you provided above and find that it works well with the latest version of Aspose.Pdf , that is Aspose.Pdf_3.8.0.0. So please try again with the new version. If there is still problems, inform us the font which does not work. We are available anytime. By the way, the font "Proxima Nova" you mentioned above is not the one Windows Supports defaultly. You must install it in advance.
Thanks for your reply. I have fixed this by making sure that every single 'text' entity has 'IsEmbedded = true' and does NOT have 'IsUnicode=true'. This works OK for a single PDF but.....
I was trying to loop through a record set and create single pdfs, and then add all their sections to a batch pdf. Is seems that at this point it loses all the text references.
Code:
Pdf singlePDF; Pdf BatchPDF = new Pdf(); foreach (blah.....) { singlePDF = new Pdf(); singlePDF.BindXml(XmlDoc); (formatting OK here) foreach (Section s in singlePDF.Sections) { BatchPDF.Sections.Add(s); (formatting lost here) } }