Frank Peters wrote:
> Hi.
> I came accross a problem mixing ortrait and landscape pages.
> Given a list of, let's call it MediaObjects.
> Each MediaObjects has an image-URL and an orientation-flag.
> I add these images to a document (first page of the document is
> portrait), each one scaled to fit onto the page, like:
>
> for (Iterator iter = imageList.iterator(); iter.hasNext();) {
> MediaObject mob = (MediaObject)iter.next();
> Rectangle pageSize = mob.getOrientation() == LANDSCAPE ?
> PageSize.A4.rotate(): PageSize.A4;
> document.setPageSize(pageSize);
> document.newPage();
> Image img = Image.getInstance(mob.getImageURL());
> float width = document.right() - document.left();
> float height = document.top() - document.bottom();
> img.scaleToFit(width, height);
> document.add(img);
> }
>
> So far, so good - everything seems to work.
> But: after the first landscape-image, pages _always_ are added landscape,
> though the pageSize is set correctly (proved it in the debugger).
> It simply does'nt switch back to portrait.
>
> Any ideas what i'm doing wrong?
Can you test something for me?
If you add some text instead of the Image,
do you still have the orientation problem?
If not, you could have found a bug in iText.
(I don't have the time to test it myself rightnow.)
br,
Bruno
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions