Foros de discusión
html to pdf converter
sasmita swain, modificado hace 11 años.
html to pdf converter
Regular Member Mensajes: 183 Fecha de incorporación: 24/02/12 Mensajes recientes
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
Gaurav Jain, modificado hace 11 años.
RE: html to pdf converter
Regular Member Mensajes: 145 Fecha de incorporación: 31/01/11 Mensajes recientes
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
Manish Yadav, modificado hace 10 años.
RE: html to pdf converter
Expert Mensajes: 493 Fecha de incorporación: 26/05/12 Mensajes recientessasmita 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
Pranoti Nandurkar, modificado hace 10 años.
RE: html to pdf converter
Junior Member Mensajes: 48 Fecha de incorporación: 3/02/12 Mensajes recientes
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();
}
}