protected Element createPageElement ( ) { String pstyle = "" ; PDRectangle layout = getCurrentMediaBox ( ) ; if ( layout != null ) { /*System.out.println("x1 " + layout.getLowerLeftX()); System.out.println("y1 " + layout.getLowerLeftY()); System.out.println("x2 " + layout.getUpperRightX()); System.out.println("y2 " + layout.getUpperRightY()); System.out.println("rot " + pdpage.findRotation());*/ float w = layout . getWidth ( ) ; float h = layout . getHeight ( ) ; final int rot = pdpage . getRotation ( ) ; if ( rot == 90 || rot == 270 ) { float x = w ; w = h ; h = x ; } pstyle = "width:" + w + UNIT + ";" + "height:" + h + UNIT + ";" ; pstyle += "overflow:hidden;" ; } else log . warn ( "No media box found" ) ; Element el = doc . createElement ( "div" ) ; el . setAttribute ( "id" , "page_" + ( pagecnt ++ ) ) ; el . setAttribute ( "class" , "page" ) ; el . setAttribute ( "style" , pstyle ) ; return el ; }
Creates an element that represents a single page .