Aspose.Pdf

Introduction to XML

XML is the most known word in the IT World for last few years. XML stands for eXtensible Markup Language. Let's understand these three words (eXtensible, Markup and Language) one by one.

 

Sample XML File:

 

<?xml version="1.0" encoding="utf-8" ?>

  <Pdf xmlns="Aspose.Pdf">

   <Section>

    <Text>

            <Segment>Hello World</Segment>

    </Text>

   </Section>

  </Pdf>

 

First of all, it's better to understand a Markup. All of us know that it's a very common practice for a reader to highlight or mark some important text using a highlighter or a marker when reading a book, paper or some other document. The text portions highlighted by a reader help him to find the important and marked topics in the document. This technique helps readers to find the important text portions from the huge documents easily.

 

Markup

 

Now, let's practice it. We take some highlighter and start highlighting a line on a page of some book till the line, we wish to highlight, ends. Now, we have highlighted a line on that page. If we take a closer look then we will find out that this highlighted text has Two Marks, one is the Start Mark (for example, <Segment> in the above sample XML code) from where we started marking the line and the sencond is End Mark (for example, </Segment> in the above sample XML code) where we stopped marking the text. We have created two boundary points for the desired text and whatever lies in between those boundaries is our Markup.

 

Tags

 

Languages allow us to define and create new things. Using XML, we create markups with the help of Tags. Every marked text is stored in between the Start and End Tag (for example, <Segment> is Start Tag and </Segment> is End Tag). Since we can define and create our own tags using XML, so we consider it as a Language.

 

And eXtensibility depicts the flexibility of XML to be used in any kind of application on any kind of platform.

 

XML and Aspose.Pdf

 

Aspose.Pdf is extensively based on XML. Aspose.Pdf utilizes XML and API to generate PDF documents from scratch. It is possible to build a template using XML and then add data at run time. And finally, convert it into PDF document.