Revision: 1089
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 7, 2006 17:08 by jnunemaker
Initial Code
<cfscript> // create document document = CreateObject("java", "com.lowagie.text.Document"); document.init(); // writer fileIO = CreateObject("java", "java.io.FileOutputStream"); fileIO.init(pdf_path); writer = CreateObject("java", "com.lowagie.text.pdf.PdfWriter"); writer.getInstance(document, fileIO); document.open(); // newsinfo header image Image = CreateObject("java", "com.lowagie.text.Image"); jpg = Image.getInstance(header_image); jpg.setAbsolutePosition(28, 713); jpg.setDpi(300,300); document.add(jpg); // top margin; dumb i know but i was in a hurry paragraph = CreateObject("java", "com.lowagie.text.Paragraph"); paragraph.init(" "); for (i=0; i lt 9; i=i+1) { document.add(paragraph); } // the fonts FontFactory = createobject("java", "com.lowagie.text.FontFactory"); Font = createObject("java", "com.lowagie.text.Font"); TimesLargeBI = Font.init(Font.TIMES_ROMAN, 14.0, Font.BOLDITALIC); TimesNormal = Font.init(Font.TIMES_ROMAN, 12.0); // all the text paragraph = CreateObject("java", "com.lowagie.text.Paragraph"); paragraph.init("Hello World!", TimesLargeBI); paragraph.setIndentationLeft(indentation_left); paragraph.setIndentationRight(indentation_right); document.add(paragraph); paragraph.init("#dateFormat(now(), 'long')#", TimesNormal); paragraph.setIndentationLeft(indentation_left); paragraph.setIndentationRight(indentation_right); document.add(paragraph); document.close(); </cfscript>
Initial URL
Initial Description
Initial Title
Creating a PDF using iText and ColdFusion
Initial Tags
line, web
Initial Language
Other