Generate PDF form from XML

The following code sample shows how to generate a PDF form from XML:

C#

using (FileStream stream = new FileStream("form.xml", FileMode.Open, FileAccess.Read))
using (FileStream file = new FileStream("form.pdf", FileMode.Create, FileAccess.Write))
{
  Document document = new Document();
  document.Write(new XmlTextReader(stream), file);
}

XML

<document>
  <section>
    <paragraph type="drawing" width="200" height="200">
      <shape width="200" height="30" x="0" y="160" type="TextFieldShape" fullname="text1" fontsize="12" value="test value" />
      <shape width="200" height="30" x="0" y="120" type="PushButtonFieldShape" fullname="button1" fontsize="12" caption="Push me" />
      <shape width="30" height="30" x="0" y="80" type="CheckBoxFieldShape" fullname="check1" fontsize="12" value="true" />
    </paragraph>
  </section>
</document>
Download TallPDF.NET 4.0
We will send you a download link
  • This field is for validation purposes and should be left unchanged.
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.