int width=paper.getWidth(); int height=paper.getHeight(); Rectangle pageSize=new RectangleReadOnly(width,height); if(paper.getOrientation().equals(Orientation.landscape)){ pageSize=pageSize.rotate();
document = new Document(new RectangleReadOnly(image.getScaledWidth(), image.getScaledHeight()));
int width=paper.getWidth(); int height=paper.getHeight(); Rectangle pageSize=new RectangleReadOnly(width,height); if(paper.getOrientation().equals(Orientation.landscape)){ pageSize=pageSize.rotate();