PDFRasterizer.NET 4.0 is now available. Supports .NET Core. Renders pixel-perfectly.
- Calculate the height of a paragraph in PDF
- Multipage TIFF to PDF
- Create PDF in C#
- Text formatting
- How to add page numbers to your PDF
- Append multiple PDF documents
- Add text field to PDF
- Convert XHTML to PDF
- Add footer with left and right aligned text on same line
- XhtmlParagraph and TrueType fonts
- What is the resulting fontsize in PDF for rich text used in a SimpleXhtmlShape
- Read and write meta data from PDF
- Merge PDF
- Stitch PDF documents
- Convert TXT to PDF
- Bulleted list from XML and XSL
- Use multiple licenses
- Generate PDF form from XML
- Generate PDF with local images from XML with Xamarin.iOS
Bulleted list from XML and XSL
This code sample helps getting a bulleted list from XML and XSL.
See PDF output.
XML
<?xml version="1.0" encoding="utf-8" ?>
<countries>
<country>
<name>Sweden</name>
</country>
<country>
<name>Norway</name>
</country>
<country>
<name>Denmark</name>
</country>
</countries>
XSL
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<document>
<section pagesize="a4" startonnewpage="true">
<xsl:apply-templates select="countries"/>
</section>
</document>
</xsl:template>
<xsl:template match="country">
<paragraph type="NumberedItem">
<numberfragment type="fragment" font="symbol" fontsize="10">·</numberfragment>
<fragment fontsize="10">
<xsl:value-of select="name"/>
</fragment>
</paragraph>
</xsl:template>
</xsl:stylesheet>
C#
// Load XML
XmlDocument xml = new XmlDocument();
xml.Load("data.xml");
// Load XSL
XslTransform xsl = new XslTransform();
xsl.Load("transform.xsl");
// Transform
XmlReader reader = xsl.Transform(xml, null);
// Write PDF
Document doc = new Document();
doc.Read(reader);
using (FileStream file = new FileStream("out.pdf", FileMode.Create, FileAccess.ReadWrite))
{
doc.Write(file);
}
Download TallPDF.NET 5.0
We will send you a download link
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download
We have sent an email with a download link.