<!-- chapterName "Frequently Asked Questions" -->

<para><b>Q.</b>  When I try to run the rml file through RML2PDF, I get errors.  Help!</para>
<para><b>A.</b>  Most errors should have a reasonably self-explanatory error message.  The most common cause of compilation errors is failing to close tags properly; e.g. a &lt;para&gt; without a &lt;/para&gt;.  Another common mistake is failing to escape certain characters within your &lt;para&gt; tags - e.g. left and right angle brackets (substitute with &amp;lt; and &amp;gt;), ampersands (substitute with &amp;amp;) etc. - refer to Google for how to escape other characters in XML.  Also, you will frequently find yourself using the wrong elements in a tag - refer to the DTD for the correct tag syntax, and remember that tags are case sensitive.</para>

<para><b>Q.</b>  I specified a table/ some text / an image in my rml document, but when I compile it to PDF, it's not there.</para>
<para><b>A.</b>  This is a common problem for beginners.  If the document complies into PDF without errors, the element is probably not visible because it's hidden behind another element, or the frame containing it is too small.  Try changing the x/y co-ordinates of the element, or expanding the size of the frames, or shrinking the size of the fonts/images/text etc, then recompile until the element becomes visible.  You can sometimes see if a hidden element is present at all by selecting the whole page with the mouse in Acrobat reader.</para>

<para><b>Q.</b>  My image/frame/table is in the wrong place.  Why?</para>
<para><b>A.</b>  Remember that in RML, co-ordinates are specified from the bottom left corner of any element, including the page itself.  This is in line with the way PostScript works, but it may be somewhat unfamiliar.</para>

<para><b>Q.</b>  I'm having trouble making sense of the DTD.  Can you help?</para>
<para><b>A.</b>  A (partial) sample entry for the image tag is as follows:</para>
<codesnippet language="xml" style="code"><![CDATA[
<!ELEMENT image EMPTY>
<!ATTLIST image
    file CDATA #REQUIRED
    x CDATA #REQUIRED
    y CDATA #REQUIRED
    width CDATA #IMPLIED
    height CDATA #IMPLIED
    showBoundary (yes | no | 0 | 1) #IMPLIED
>
]]></codesnippet>
<para>From this entry, you can see the following:</para>
<para style="nospace">• using this tag requires a filename, along with x and y coordinates (these are marked as CDATA #REQUIRED).</para>
<para style="nospace">• the width and height are optional 'chardata' parameters (marked as CDATA #IMPLIED).</para>
<para style="nospace">• the showBoundary parameter is optional (#IMPLIED) and shows a list of the permitted values.</para>

<para>So a sample use of this tag would be &lt;image file="pic.jpg" x="0" y="0" showBoundary="yes"&gt;, which would place the a picture 'pic.jpg' at the bottom left corner of a document, with a surrounding border.</para>

<para><b>Q.</b>  How do I specify the page size &amp; orientation?</para>
<para><b>A.</b>  The page size defaults to A4, portrait.  You can change it for the whole document within the &lt;template&gt; tag, and you can override it for individual pages using the &lt;pageTemplate&gt; tag.</para>

<para><b>Q.</b> How can I use my own fonts?</para>
<para><b>A.</b> By default, you can use the 14 standard fonts supplied with Acrobat Reader.  However, RML also accepts TrueType and Type1 fonts.  Examples of how to use them are in test_005_fonts.rml and test_023_ttfonts.rml in the rml2pdf/tests/ directory.</para>

<para><b>Q.</b> Sorry, I still don't get it.</para>
<para><b>A.</b> Try reading the manual in rml2pdf/docs; look at the test cases in rml2pdf/test/ , or have a look at the code snippets on the ReportLab website.</para>

<para><b>Q.</b> I'm a bit confused about how to use 'feature X'</para>
<para><b>A.</b> Try reading the manual in rml2pdf/docs; look at the test cases in rml2pdf/test/ , or have a look at the code snippets on the ReportLab website.</para>

<para><b>Q.</b> I really need to use 'feature Y'.  Does RML support it?</para>
<para><b>A.</b> Try reading the manual in rml2pdf/docs; look at the test cases in rml2pdf/test/ , or have a look at the code snippets on the ReportLab website.</para>

<para><b>Q.</b> I've discovered how to do something amazing in RML.  How can I tell the world?</para>
<para><b>A.</b> Post a code snippet on the ReportLab website!  Go to http://www.reportlab.com/snippets </para>