From brian.sorg at liberatinginsight.com Sun Aug 22 00:08:49 2004 From: brian.sorg at liberatinginsight.com (Brian Sorg) Date: Sat, 21 Aug 2004 19:08:49 -0500 Subject: [cl-typesetting-devel] Cl-pdf & cl-typesetting usage documentation expanded Message-ID: <4127E411.9040208@liberatinginsight.com> Hello everyone, I just wanted to let you know that I have released a major upgrade to the usage documentation for cl-pdf and cl-typesetting. It is based on version 2.1 and documents most of features that one would use to create a pdf document. It can be found at www.liberatinginsight.com/open-projects.html. There you can view the documentation online or download a zip file. The documentation is html formatted. If anyone finds mistakes or has information to add please let me know. The next steps I plan to take are to: 1. Create a few short tutorials by solving typical problems, ie business letters, avery label creation, etc 2. Update the documentation to match the current release 3. Document the remaining features 4. Generate the documentation using cl-typesetting Brian Sorg Director: Liberating Insight LLC Office: 260-745-2211 Mobile: 260-602-1086 Fax: 614-839-9208 www.LiberatingInsight.com From cph at chi-square-works.com Mon Aug 30 17:50:53 2004 From: cph at chi-square-works.com (Chisheng Huang) Date: Mon, 30 Aug 2004 17:50:53 +0000 (GMT) Subject: [cl-typesetting-devel] making a huge poster with cl-typesetting Message-ID: Greetings, I'd like to make a poster of many (3 ~ 6) columns of text and graphics. Is this possible with CL-TYPESETTING? I just started poking around in the source code of CL-TYPESETTING. There are 3 issues that pop up in my mind: 1. I think I'll have to add an entry to the definition of +PAGER-SIZES+ to generate a poster bigger than the A0 size. 2. I'm not sure how to get the multicolumn format I need. There are TABLE, ROW, and CELL in CL-TYPESETTING but I need the text to flow from the bottom of a column to the top of the next column to the right. 3. All my graphics stuff is generated by CL-PDF separately. Any way to import these PDF files into a PDF file (the poster being generated by CL-TYPESETTING)? If you can shed any light on any one of the above issues, I'll be very grateful. Best, -cph, back to poke around in the CL-PDF/CL-TYPESETTING src code. From marc.battyani at fractalconcept.com Mon Aug 30 22:05:55 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 31 Aug 2004 00:05:55 +0200 Subject: [cl-typesetting-devel] Cl-pdf & cl-typesetting usage documentation expanded References: <4127E411.9040208@liberatinginsight.com> Message-ID: <0fbf01c48edd$87ae7310$0a02a8c0@marcxp> "Brian Sorg" wrote: #| Sorry for the reply delay but your ISP refuses my emails to you and the mailing lists were down :( |# > I just wanted to let you know that I have released a major upgrade to > the usage documentation for cl-pdf and cl-typesetting. It is based on > version 2.1 and documents most of features that one would use to create > a pdf document. It can be found at > www.liberatinginsight.com/open-projects.html. There you can view the > documentation online or download a zip file. The documentation is html > formatted. Cool! > If anyone finds mistakes or has information to add please let me know. > > The next steps I plan to take are to: > > 1. Create a few short tutorials by solving typical problems, ie business > letters, avery label creation, etc Good, this is really missing for now. > 2. Update the documentation to match the current release It's still a moving target... > 3. Document the remaining features Good. > 4. Generate the documentation using cl-typesetting Yes, this one is a must ;-) Have you got some feedback on this ? (Well, probably not. I have lots of downloads for my open-source projects but almost never any feedback :() Automatic documentation generation is a topic I will probably add to cl-typesetting. I've already added graph generation/typesetting and tomorrow I will release a cl-typesetting pretty printer for lisp files. This could be combined with some XRef utilities in the CMU Lisp repository or with something like Albert for some cute documentation generation. Any volunteers to help ? Marc From marc.battyani at fractalconcept.com Mon Aug 30 22:14:57 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 31 Aug 2004 00:14:57 +0200 Subject: [cl-typesetting-devel] making a huge poster with cl-typesetting References: Message-ID: <0fc801c48ede$caa2fe60$0a02a8c0@marcxp> "Chisheng Huang" wrote: > I'd like to make a poster of many (3 ~ 6) columns of text and graphics. > Is this possible with CL-TYPESETTING? No problem. David J Cooper Jr used cl-typesetting and cl-pdf to typeset a nice GDL pamphlet. Here it is: http://www.genworks.com/downloads/gdl-pamphlet-portrait.pdf > I just started poking around > in the source code of CL-TYPESETTING. There are 3 issues that pop up > in my mind: > 1. I think I'll have to add an entry to the definition of +PAGER-SIZES+ > to generate a poster bigger than the A0 size. > 2. I'm not sure how to get the multicolumn format I need. There are TABLE, > ROW, and CELL in CL-TYPESETTING but I need the text to flow from the > bottom of a column to the top of the next column to the right. For 1 and 2: You can't use the top level functions for generating a document as they don't support multi-columns yet. You have to manually call draw-block with your columns coordinates as shown in full-example in test.lisp (where I have 4 columns on the first page). Tables are not usable because you want the text to overflow from a columns to the next one. > 3. All my graphics stuff is generated by CL-PDF separately. Any way to > import these PDF files into a PDF file (the poster being generated by > CL-TYPESETTING)? Not yet. The best way for now is to directly call the cl-pdf generating function directly like it's done in the examples. > If you can shed any light on any one of the above issues, I'll be very > grateful. > -cph, back to poke around in the CL-PDF/CL-TYPESETTING src code. Great! Marc From cph at chi-square-works.com Mon Aug 30 23:34:17 2004 From: cph at chi-square-works.com (Chisheng Huang) Date: Mon, 30 Aug 2004 16:34:17 -0700 Subject: [cl-typesetting-devel] making a huge poster with cl-typesetting In-Reply-To: <0fc801c48ede$caa2fe60$0a02a8c0@marcxp> (Marc Battyani's message of "Tue, 31 Aug 2004 00:14:57 +0200") References: <0fc801c48ede$caa2fe60$0a02a8c0@marcxp> Message-ID: > No problem. David J Cooper Jr used cl-typesetting and cl-pdf to typeset a > nice GDL pamphlet. > Here it is: > http://www.genworks.com/downloads/gdl-pamphlet-portrait.pdf Thanks for the URL. >> 2. I'm not sure how to get the multicolumn format I need. There are > TABLE, >> ROW, and CELL in CL-TYPESETTING but I need the text to flow from the >> bottom of a column to the top of the next column to the right. > > For 1 and 2: You can't use the top level functions for generating a document > as they don't support multi-columns yet. You have to manually call > draw-block with your columns coordinates as shown in full-example in ^^^^^^^^^^ Yes, I came across this little gem in test.lisp while poking around and thought it was the key to create a multicolumn poster. Thank you for the confirmation. >> 3. All my graphics stuff is generated by CL-PDF separately. Any way to >> import these PDF files into a PDF file (the poster being generated by >> CL-TYPESETTING)? > > Not yet. The best way for now is to directly call the cl-pdf generating > function directly like it's done in the examples. Directly calling CL-PDF to generate plots is not feasible for my case:( Attached at the end is some code I hacked up. The problem is it does not work:( It will generate 3 pdf files: red.pdf, green.pdf, and test.pdf. The file test.pdf is supposed to import and display red.pdf and green.pdf. But using acroread on a Linux box only gives me a grey background enlarged to 1600%. Could someone please take a look at the code and tell me what I'm missing? I really hate to use the sucky CorelDRAW on a PC to make a poster. Best wishes, -cph ps. PDF:ADD-EXTERNAL-LINK is not what I want. Sorry about that noise in my previous email. ;;================================================================== (in-package :pdf) (defclass reference-xobject (indirect-object) ((name :reader name :initform (gen-name "/REFXOBJ") :initarg :name) (filename :reader filename :initarg :filename) (page :reader page :initform 0 :initarg :page))) (defmethod initialize-instance :after ((ref-xobj reference-xobject) &rest initargs &key filename page (llx 0) (lly 0) (urx 1000000) (ury 1000000) &allow-other-keys) (declare (ignore initargs)) (let ((ref-dict (make-instance 'dictionary :dict-values `(("/F" . ,(concatenate 'string "(" filename ")")) ("/Page" . ,page))))) (setf (content ref-xobj) (make-instance 'pdf-stream :no-compression t :dict-values `(("/Type" . "/XObject") ("/Subtype" . "/Form") ("/BBox" . ,(format nil "[~A ~A ~A ~A]" llx lly urx ury)) ("/Ref" . ,ref-dict)))))) (defun add-reference-xobjects-to-page (&rest reference-xobjects) (dolist (rx reference-xobjects) (add-dict-value (xobjects *page*) (name rx) rx))) (defun paint-reference-xobject (ref-xobj) (format *page-stream* "~a Do~%" (name ref-xobj))) (defun draw-reference-xobject (ref-xobj x y) (move-to x y) (paint-reference-xobject ref-xobj)) ;;------------------------------------------------------------------ ;; testing... (with-document () (with-page (:bounds #(0 0 100 100)) (set-rgb-fill 1.0 0.0 0.0) (rectangle 0 0 100 100) (fill-path)) (write-document "/tmp/red.pdf")) (with-document () (with-page (:bounds #(0 0 100 100)) (set-rgb-fill 0.0 1.0 0.0) (rectangle 0 0 100 100) (fill-path)) (pdf:write-document "/tmp/green.pdf")) (with-document () (with-page () (with-outline-level ("test" (register-page-reference)) (let ((red (make-instance 'reference-xobject :name "red" :filename "/tmp/red.pdf" :page 0 :urx 100 :ury 100)) (green (make-instance 'reference-xobject :name "green" :filename "/tmp/green.pdf" :page 0 :urx 100 :ury 100))) (add-reference-xobjects-to-page red green) (draw-reference-xobject red 200 200) (draw-reference-xobject green 400 400) (rectangle 200 200 200 200) (stroke)))) (write-document "/tmp/test.pdf")) From marc.battyani at fractalconcept.com Tue Aug 31 18:46:30 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 31 Aug 2004 20:46:30 +0200 Subject: [cl-typesetting-devel] making a huge poster with cl-typesetting References: <0fc801c48ede$caa2fe60$0a02a8c0@marcxp> Message-ID: <1ced01c48f8a$d69f00e0$0a02a8c0@marcxp> "Chisheng Huang" wrote: > > Directly calling CL-PDF to generate plots is not feasible for my case:( > Attached at the end is some code I hacked up. The problem is it does not > work:( It will generate 3 pdf files: red.pdf, green.pdf, and test.pdf. > The file test.pdf is supposed to import and display red.pdf and green.pdf. > But using acroread on a Linux box only gives me a grey background enlarged > to 1600%. Could someone please take a look at the code and tell me what > I'm missing? I really hate to use the sucky CorelDRAW on a PC to make > a poster. [...] > (with-document () > (with-page () > (with-outline-level ("test" (register-page-reference)) > (let ((red (make-instance 'reference-xobject > :name "red" It's :name "/red" as it's a pdf name. > :filename "/tmp/red.pdf" > :page 0 > :urx 100 > :ury 100)) > (green (make-instance 'reference-xobject > :name "green" :name "/green" > :filename "/tmp/green.pdf" > :page 0 > :urx 100 > :ury 100))) > (add-reference-xobjects-to-page red green) > (draw-reference-xobject red 200 200) > (draw-reference-xobject green 400 400) > (rectangle 200 200 200 200) > (stroke)))) > (write-document "/tmp/test.pdf")) With the / added you get a blank page so there is some progress ;-) I think there is probably something missing in the XObject dictionnaries. Maybe something to tell that it's a pdf file (a /ProcSet [ /PDF /Text ] ?) You can also probably embed the content of the linked pdf into the master one. This is even more interesting I think. You should try to find or generate (with pdftex for instance ?) some pdf with an embedded pdf to see what is missing. (I had a quick look at the pdf ref but it's not obvoius) Marc