Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

IsHtmlTagSupported, FontName and FontSize

$
0
0
I'm having difficulty getting what worked in version 2.2 to work in our newly upgraded version 8.5 of Aspose.Pdf.

Having set a font name and size for a text element I find that these values are ignored if IsHtmlTagSupported is set to true.

If, however I set UseTextInfoStyle="true", the font name and size are correct but all the HTML tags are then ignored.

This is the c# code demonstrating the issue:


//Instantiate the Pdf instancePdf pdf = new Pdf();
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(@"c:\Development\Libs\Aspose.Pdf.lic");//Bind the XML and XSLT file
pdf.BindXML(@"c:\temp\test.xml"null);//Save the resultant PDF
pdf.Save(@"c:\temp\test.pdf");
and the XML:

<Pdf xmlns="Aspose.Pdf">
<Section
PageMarginRight="25"
PageMarginTop="25"
PageMarginLeft="25"
PageMarginBottom="25"
PageWidth="816"
PageHeight="1050" >
<Text
MarginTop="0.5cm"
FontName="Tahoma"
FontSize="10">
<Segment>
This is the basic text.
</Segment>
</Text>
<Text
MarginTop="0.5cm"
IsHtmlTagSupported="true"
FontName="Tahoma"
FontSize="10">
<Segment>
This is &lt;span style="color: red;">also&lt;/span> test text with IsHtmlTagSupported="true".
</Segment>
</Text>
<Text
MarginTop="0.5cm"
IsHtmlTagSupported="true"
UseTextInfoStyle="true"
FontName="Tahoma"
FontSize="10">
<Segment>
This is &lt;span style="color: red;">also&lt;/span> test text with IsHtmlTagSupported="true" and UseTextInfoStyle="true".
</Segment>
</Text>
</Section>
</Pdf>

As you can see from the attached screenshot, only the first line is correct.

I am expecting the font name and size to be inhirited in the HTMLand this is not happening.

Your help would be appreciated.



Viewing all articles
Browse latest Browse all 3131

Trending Articles