Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
html to pdf converter
Hi
I am working on LR6.1 ga2.. i want to convert html page to pdf converter..can any body tell me how to convert one html page to pdf and that pdf i have to send in user mailid..
Thanks
Sasmita
I am working on LR6.1 ga2.. i want to convert html page to pdf converter..can any body tell me how to convert one html page to pdf and that pdf i have to send in user mailid..
Thanks
Sasmita
You can use open office for the document conversions.
Liferay has inbuilt features for integration with open-office.
Some reference links:
http://itsliferay.wordpress.com/2012/09/10/document-conversion-using-liferay-way/
http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/openoffice
http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/lp-6-1-ugen12-server-administration-0
Liferay has inbuilt features for integration with open-office.
Some reference links:
http://itsliferay.wordpress.com/2012/09/10/document-conversion-using-liferay-way/
http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/openoffice
http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/lp-6-1-ugen12-server-administration-0
sasmita swain:
Hi
I am working on LR6.1 ga2.. i want to convert html page to pdf converter..can any body tell me how to convert one html page to pdf and that pdf i have to send in user mailid..
Thanks
Sasmita
Try Apache PDFBox
Regards,
Manish Banwari Lal Yadav
Hi,
you can use iText converter to convert HTML to pdf:
Java code using iText API is :
you can use iText converter to convert HTML to pdf:
Java code using iText API is :
private void createPDF (){
String path = "D:/Deiva/Test.pdf";
PdfWriter pdfWriter = null;
//create a new document
Document document = new Document();
try {
//get Instance of the PDFWriter
pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(path));
//document header attributes
document.addAuthor("betterThanZero");
document.addCreationDate();
document.addProducer();
document.addCreator("MySampleCode.com");
document.addTitle("Demo for iText XMLWorker");
document.setPageSize(PageSize.LETTER);
//open document
document.open();
InputStream is = new FileInputStream("D:/Deiva/CRs/Oncology/Phase5/CR1/HTMLPage/Article.html");
// create new input stream reader
InputStreamReader isr = new InputStreamReader(is);
//get the XMLWorkerHelper Instance
XMLWorkerHelper worker = XMLWorkerHelper.getInstance();
//convert to PDF
worker.parseXHtml(pdfWriter, document, isr);
//close the document
document.close();
//close the writer
pdfWriter.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Community
Company
Feedback