From jmckitrick at reedlarkeygroup.com Sat Feb 24 15:14:04 2007 From: jmckitrick at reedlarkeygroup.com (Jonathon McKitrick) Date: Sat, 24 Feb 2007 10:14:04 -0500 (EST) Subject: [cl-typesetting-devel] Calling functions within 'compile-text' Message-ID: <49201.68.44.154.215.1172330044.squirrel@reedlarkeygroup.com> Question: if I am building a rather large document and the code within 'compile-text' is becoming long and unwieldy, is there a way that I can break this into functions whose results are returned and appended to the content compile-text is building? Until now, I've been using function calls inside a with-document block and each function calls with-page. But since I've moved to more of a typesetting approach, the entire document is build inside compile-text, and it's becoming a very long, involved piece of code. Is there a simple way to call functions within compile-text such that each will add content by accessing the lexical environment being built within the compile-text block and without having to be a macro ? -- Jonathon McKitrick Reed Larkey Group From jmckitrick at reedlarkeygroup.com Sat Feb 24 19:39:00 2007 From: jmckitrick at reedlarkeygroup.com (Jonathon McKitrick) Date: Sat, 24 Feb 2007 14:39:00 -0500 (EST) Subject: [cl-typesetting-devel] page breaks using draw-pages Message-ID: <49849.68.44.154.215.1172345940.squirrel@reedlarkeygroup.com> I'm trying to generate content in one big block and write it out in pages with draw-pages. The problem is :eop doesn't seem to be outputting a fresh page as I would expect. What am I doing wrong? -- Jonathon McKitrick Reed Larkey Group From jmckitrick at reedlarkeygroup.com Sat Feb 24 20:17:16 2007 From: jmckitrick at reedlarkeygroup.com (Jonathon McKitrick) Date: Sat, 24 Feb 2007 15:17:16 -0500 (EST) Subject: [cl-typesetting-devel] page breaks using draw-pages In-Reply-To: <49849.68.44.154.215.1172345940.squirrel@reedlarkeygroup.com> References: <49849.68.44.154.215.1172345940.squirrel@reedlarkeygroup.com> Message-ID: <49946.68.44.154.215.1172348236.squirrel@reedlarkeygroup.com> Here's some code: (defun add-par () (paragraph (:font "Times-Roman" :font-size 24) "old page") :eop (paragraph (:font "Times-Roman" :font-size 24) "new page")) (defun report-write-to-file (filename) (tt:with-document () (let* ((header (lambda (pdf:*page*) (compile-text () "Header"))) (footer (lambda (pdf:*page*) (compile-text (:font "Times-Roman" :font-size 12) (paragraph (:h-align :center) (verbatim (format nil "~D" pdf:*page-number*)))))) (content (compile-text () (add-par)))) (draw-pages content :margins '(108 72 72 72) :header header :footer footer) (when pdf:*page* (finalize-page pdf:*page*)) (pdf:write-document (concatenate 'string "web/data/" filename))))) What I need to be able to do is generate content via function calls, since there is too much to fit into just this function. But those function calls need to be able to generate page breaks. In this example, 'add-par' is not able to create a new page. -- Jonathon McKitrick Reed Larkey Group From brian.sorg at liberatinginsight.com Sat Feb 24 22:49:25 2007 From: brian.sorg at liberatinginsight.com (Brian Sorg) Date: Sat, 24 Feb 2007 17:49:25 -0500 Subject: [cl-typesetting-devel] page breaks using draw-pages In-Reply-To: <49849.68.44.154.215.1172345940.squirrel@reedlarkeygroup.com> References: <49849.68.44.154.215.1172345940.squirrel@reedlarkeygroup.com> Message-ID: <1172357365.3951.11.camel@melody.liberating> Jonathon - Try using the function (tt:new-page) within the compile-text macro instead. This works for me. Also I fixed the link the the cl-pdf documentation on the page http://liberatinginsight.com/open-projects.html These are fairly out of date but I hope they help a little. I do hope to start working on these again soon, but I can't say how quickly any of that will happen. On Sat, 2007-02-24 at 14:39 -0500, Jonathon McKitrick wrote: > I'm trying to generate content in one big block and write it out in pages > with draw-pages. The problem is :eop doesn't seem to be outputting a > fresh page as I would expect. > > What am I doing wrong? > -- Brian Sorg Director & Founder Liberating Insight LLC brian.sorg at liberatinginsight.com Mobile: 260-602-1086 Office: 260-918-0490