Author: norman.richards(a)jboss.com
Date: 2008-06-26 11:05:33 -0400 (Thu, 26 Jun 2008)
New Revision: 8424
Modified:
trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java
Log:
JBSEAM-3069
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java 2008-06-26 14:54:42 UTC (rev
8423)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java 2008-06-26 15:05:33 UTC (rev
8424)
@@ -21,6 +21,7 @@
import com.lowagie.text.Element;
import com.lowagie.text.Rectangle;
import com.lowagie.text.html.HtmlWriter;
+import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfTemplate;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.rtf.RtfWriter2;
@@ -141,8 +142,8 @@
// do nothing
} else if (orientation.equalsIgnoreCase("landscape")) {
Rectangle currentSize = document.getPageSize();
- document.setPageSize(new Rectangle(currentSize.height(),
- currentSize.width()));
+ document.setPageSize(new Rectangle(currentSize.getHeight(),
+ currentSize.getWidth()));
} else {
throw new RuntimeException("orientation value " + orientation +
"unknown");
}
@@ -321,11 +322,15 @@
return writer;
}
- public PdfTemplate createPdfTemplate(float width, float height) {
+ public PdfContentByte getPdfContent() {
PdfWriter writer = (PdfWriter) getWriter();
- return writer.getDirectContent().createTemplate(width, height);
+ return writer.getDirectContent();
}
+ public PdfTemplate createPdfTemplate(float width, float height) {
+ return getPdfContent().createTemplate(width, height);
+ }
+
private DocumentType documentTypeForName(String typeName) {
if (typeName != null) {
if (typeName.equalsIgnoreCase("pdf")) {