Samuel Gabriel <sgabriel <at> brainfuse.com> writes:

> 
> Thanks Bruno, you are the best, never thought it would be that easy :)
> Sam
> 
> -----Original Message-----
> From: itext-questions-admin <at> lists.sourceforge.net
> [mailto:itext-questions-admin <at> lists.sourceforge.net] On Behalf Of Bruno
> Lowagie
> Sent: Saturday, February 19, 2005 5:07 AM
> To: Samuel Gabriel
> Cc: itext-questions <at> lists.sourceforge.net
> Subject: Re: [iText-questions] Landscape XML->PDF
> 
> Samuel Gabriel wrote:
> 
> >
> > I would like to submit the code so that it will be part of iText 1.3, 
> > please let me know who would be responsible for that.
> >
> >  
> >
> I have uploaded your version of SAXiTextHandler.java as-is to CVS.
> I'll check the contents later on. As it is in the CVS repository,
> it will be included in the next release (probably 1.2.4).
> br,
> Bruno
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> iText-questions mailing list
> iText-questions <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> 


Now that you have done such a good job, can we add this code to add margins as 
well:


            float topMargin= 36;  // TODO : find a way to get default 
values ... 
            float rightMargin = 36;
            float leftMargin = 36;
            float bottomMargin = 36;


            for (Iterator i = attributes.keySet().iterator(); i.hasNext(); ) {
                key = (String) i.next();
                value = attributes.getProperty(key);
//new code starts here
                try{
                   if ( ElementTags.LEFT.equalsIgnoreCase(key))
                       leftMargin = Float.valueOf(value + "f").floatValue();
                   if ( ElementTags.RIGHT.equalsIgnoreCase(key))
                       rightMargin = Float.valueOf(value + "f").floatValue();
                   if ( ElementTags.TOP.equalsIgnoreCase(key))
                       topMargin = Float.valueOf(value + "f").floatValue();
                   if ( ElementTags.BOTTOM.equalsIgnoreCase(key))
                       bottomMargin = Float.valueOf(value + "f").floatValue();

                }catch(Exception ex){
                    throw new ExceptionConverter(ex);
                }
// end of new code                
                if (  PAGE_SIZE.equals(key))
                {
                  try {



           if ( "landscape".equals(orientation))
               pageSize = pageSize.rotate();
            document.setPageSize(pageSize);
            //pageSize  =
            document.setMargins(leftMargin,rightMargin,topMargin,bottomMargin);







-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to