We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.pdf xsl file not able to format text

Hi All,

We have used Aspose in our web application. We have Aspose_invoice.xsl file which in through web application sends as pdf as an attachment to an email. I am trying to make some changes to this xsl file the change is pretty straightforward adding a text which has our web link and email id and should be displayed as blue. I have added my code as below
<Text MarginTop = "1cm FontSize = “8”>
Some Text…
with links to www.xxx.org.au/supporterprivacy support@domain.com ( the two should be displayed in blue rest of text in black as they are hyperlinks)

I have tried different options of formatting but none of them worked like and Text tag with Color , segment tag with color to blue but none of them worked. Any help would be highly appreciated .

Thanks,
Prat

Hi Prat,


Thanks for contacting support.

In order to accomplish your requirements, please try using following XML and code snippet. For your reference, I have also attached the PDF file generated with latest release of Aspose.Pdf for .NET 10.9.0.

[C#]

Aspose.Pdf.Generator.Pdf
pdf = new Pdf();<o:p></o:p>

pdf.BindXML("c:/pdftest/testfile.XSL", null);

pdf.Save(“c:/pdftest/testfile.pdf”);


[XML]

<Pdf xmlns=Aspose.Pdf><o:p></o:p>

<Section TextColor="Black">

<Text>

<Segment>paragraph 1</Segment>

</Text>

<Text MarginTop="10">

<Segment>paragraph 2</Segment>

</Text>

<Text MarginTop="10" Color="Red">

<Segment>Some Text......with links to </Segment>

<Segment Color="Blue">www.xxx.org.au/supporterprivacy</Segment>

<Segment Color="Blue"> </Segment>

<Segment Color="Blue">support@domain.com</Segment>

</Text>

<Text MarginTop="10">

<Segment>paragraph 4</Segment>

</Text>

</Section>

</Pdf>