summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java10
-rw-r--r--test/layoutengine/standard-testcases/fox_external-document_2.xml4
2 files changed, 10 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
index 7cbe33f26..aae5a6b30 100644
--- a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
@@ -242,8 +242,14 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
pv.setPage(pageArea);
RegionViewport rv = new RegionViewport(referenceRect);
- rv.setIPD(referenceRect.width);
- rv.setBPD(referenceRect.height);
+
+ if (pageSeq.getReferenceOrientation() % 180 == 0) {
+ rv.setIPD(referenceRect.width);
+ rv.setBPD(referenceRect.height);
+ } else {
+ rv.setIPD(referenceRect.height);
+ rv.setBPD(referenceRect.width);
+ }
rv.setClip(true);
BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
diff --git a/test/layoutengine/standard-testcases/fox_external-document_2.xml b/test/layoutengine/standard-testcases/fox_external-document_2.xml
index b2f397580..29485ed72 100644
--- a/test/layoutengine/standard-testcases/fox_external-document_2.xml
+++ b/test/layoutengine/standard-testcases/fox_external-document_2.xml
@@ -71,8 +71,8 @@
<eval expected="0 0 597172 843913" xpath="//viewport[@prod-id = 'img4']/@pos"/>
<eval expected="0 0 843913 597172" xpath="//pageViewport[@nr = '6']/page/regionViewport/@rect"/>
- <eval expected="843913" xpath="//pageViewport[@nr = '6']/page/regionViewport/@ipd"/>
- <eval expected="597172" xpath="//pageViewport[@nr = '6']/page/regionViewport/@bpd"/>
+ <eval expected="597172" xpath="//pageViewport[@nr = '6']/page/regionViewport/@ipd"/>
+ <eval expected="843913" xpath="//pageViewport[@nr = '6']/page/regionViewport/@bpd"/>
<eval expected="597172" xpath="//pageViewport[@nr = '6']/page/regionViewport/regionBody/@ipd"/>
<eval expected="843913" xpath="//pageViewport[@nr = '6']/page/regionViewport/regionBody/@bpd"/>
<eval expected="[0.0 -1.0 1.0 0.0 0.0 597172.0]" xpath="//pageViewport[@nr = '6']/page/regionViewport/regionBody/@ctm"/>