orientationVal = PageFormat.PORTRAIT;
}
if (pageformatName != null)
{
final Paper p = PageFormatFactory.getInstance().createPaper(pageformatName);
if (p == null)
{
PageDefinitionReadHandler.logger.warn("Paper size '" + pageformatName + "' is not regognized.");
return defaultPageFormat;
}
return PageFormatFactory.getInstance().createPageFormat(p, orientationVal);
}
if (atts.getValue(getUri(), "width") != null && atts.getValue(getUri(), "height") != null)
{
final int[] pageformatData = new int[2];
pageformatData[0] = ParserUtil.parseInt(atts.getValue(getUri(), "width"),
"Specified attribute 'width' is not valid", getLocator());
pageformatData[1] = ParserUtil.parseInt(atts.getValue(getUri(), "height"),
"Specified attribute 'height' is not valid", getLocator());
final Paper p = PageFormatFactory.getInstance().createPaper(pageformatData);
if (p == null)
{
PageDefinitionReadHandler.logger.warn("Unable to create the requested Paper size with width " +
pageformatData[0] + " and height " + pageformatData[1]);
return defaultPageFormat;