Search This Blog

Wednesday, November 27, 2019

IText - Alignment, Page Size Html to Pdf

Document document = new Document ();
PdfWriter writer = PdfWriter.getInstance ( document, new FileOutputStream ( "d:/fhpl.pdf" ) );
document.setMargins ( 0.1f, 0.1f, 0.1f, 0.1f );
document.setPageSize ( PageSize.A3 );
document.open ();
XMLWorkerHelper.getInstance ().parseXHtml ( writer, document, new FileInputStream ( "d:/fhpl1.html" ) );
document.close ();



Note: Before document.open(); to place all your customize settings.

No comments:

Hit Counter


View My Stats