Page events don't work with RTF creation, as the client renders the 
document when it is opened.

That being said there is a footerheader object as part of the rtf 
writer.  I called it, it isn't throwing an error, and I can see my text 
in the document when opened in notepad, but not in word.

The last two posts have really helped me out a lot, let me clean up what 
I have and see where I am.

Thanks man.  I've sen you all over the iText forums and mailing list, 
you seem to be the CF community expert :)

Paul Hastings wrote:
> Loathe wrote:
>> 1.  How do I create an 8.5" x 11 page?
> 
> pageSize=createObject("java", "com.lowagie.text.PageSize").init();
> doc=createObject("java","com.lowagie.text.Document").init(pageSize.LETTER,0,0,0,0);
> 
>> 2.  How do I have a 1" margin?
> 
> the 0,0,0,0 bit above are the margins in points. 1"=72pt.
> 
>> 3.  How do I create a header that actually displays in the page?
> 
> there's a couple of approaches to this:
> 
> page events, cfsearching blog has a superb set of posts on itext & cf, this 
> one 
> is about page events 
> http://cfsearching.blogspot.com/2008/03/instructions-for-cf-itext.html
> 
> directContent (ie stick any text/image/etc anywhere on the page):
> <cfscript>
> myObj = structNew();
> local = structNew();
> 
> BaseFont=createObject("java", "com.lowagie.text.pdf.BaseFont");
> bf=baseFont.createFont(BaseFont.COURIER,BaseFont.CP1252,BaseFont.EMBEDDED);
> 
> myObj.document=CreateObject("java", "com.lowagie.text.Document");
> newFile=expandPath("test.pdf");
>       
> myObj.fileIO=createObject("java","java.io.FileOutputStream").init(newFile);
> myObj.pdfWriter=CreateObject("java", "com.lowagie.text.pdf.PdfWriter");
> myObj.vertText=createObject("java","com.lowagie.text.pdf.VerticalText");
> myObj.pdfContentByte=createObject("java","com.lowagie.text.pdf.PdfContentByte");
> // create document
> myObj.document.init();
> // call the static 'getInstance' factory method
> local.writer=myObj.pdfWriter.getInstance(myObj.document, myObj.fileIO);
> // open the document
> myObj.document.open();
> local.cb=local.writer.getDirectContent();
> local.cb.beginText();
> local.cb.setFontAndSize(bf, 12.0);
> local.cb.showTextAligned(1, 'THIS IS A TEST', 100, 100, 0);
> local.cb.endText();
> myObj.document.close();
> </cfscript>
> 
>> 4.  How do I add page numbers, after the first page only, in the footer?
> 
> see #3.
> 
>> I've found tutorials and examples online to do all of this in pure java, 
>> but I'm having a hell of a time of it trying to convert that into CF. 
> 
> porting from bruno's java examples to cf is fairly straightforward. where are 
> you getting stuck?
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307328
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to