//ByteArrayOutputStream baos = new ByteArrayOutputStream();
Document document = new Document();
document.setPageSize(PageSize.LETTER);
//Rectangle rect = document.getPageSize();
//PdfCopy writer = new PdfCopy(document, baos);
document.open();
GenericValue dataResource = null;
if (UtilValidate.isEmpty(contentRevisionSeqId)) {
GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId));
dataResourceId = content.getString("dataResourceId");