03-27-2012 11:57 PM
03-28-2012 03:12 AM
08-31-2019 06:50 AM
Hi ,
It seems like already a file exits with same name, to create a pdf file hope this snippet helps you
// Create new nodes
FileInfo fileInfoPdf = this.fileFolderService.create(parentNoderef, "test_doc.pdf", ContentModel.TYPE_CONTENT);
this.pdfNode = fileInfoPdf.getNodeRef();
ContentWriter contentWriter = this.contentService.getWriter(fileInfoPdf.getNodeRef(), ContentModel.PROP_CONTENT, true);
contentWriter.setEncoding("UTF-8");
contentWriter.setMimetype(MimetypeMap.MIMETYPE_PDF);
contentWriter.putContent(pdfStream);
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.