#6 XML to PDF Document PageSize and Margins


I've been working with iText.Net for a while and have
truly enjoyed it. Just recently I started working on
an XML based template system. All of the pdfs kept
coming out as A4 sized pages instead of what I actually
set the document as and the margins wouldn't adjust to
the margins I specified either. So after some
researching tracing back through the source code for
iTextdotNet it turns out that for some reason in
com.lowagie.text.xml.SAXiTextHandler line 440 it is
statically setting the page size. I verfied that this
was the culprit by changing the pagesize there and
recompiling iTextdotNet. Using the new set or dlls I
ran my test program and tracked the pagesize and it
actually came out whatever size I specified in the
SAXiTextHandler on line 440 instead of what I had
originally set before passing it to XMLParser.parse().
Since I'm not a J# person this is about as much
assistance as I can give. I'll do anything more I can
just let me know.


  • Kazuya Ujihara

    Kazuya Ujihara - 2005-11-10

    Logged In: YES

    Describe page size, orientation, margins as attriutes in
    document root like the following.

    <?xml version="1.0"?>
    <PLAY pagesize="LETTER" orientation="landscape">
    <PLAYTITLE>The Tragedy of Romeo and
    <NEWLINE />

  • Kazuya Ujihara

    Kazuya Ujihara - 2005-11-10
    • status: open --> closed-works-for-me

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks