From philpot at ISI.EDU Sat Jan 22 01:22:15 2005 From: philpot at ISI.EDU (Andrew Philpot) Date: Fri, 21 Jan 2005 17:22:15 -0800 Subject: [cl-typesetting-devel] cl-typesetting documents with damaged xref table Message-ID: <200501220122.j0M1MGgv008531@blombos.isi.edu> I'm generating documents dynamically using cl-typesetting and then serving them to a web browser. I'm doing something wrong, however. Some browsers' pdf plugins, and some printer drivers as well, just give up. Linux xpdf complains about my documents, although it usually displays them correctly. The xpdf error message is Error (O): PDF file is damaged. Attempting to reconstruct XREF table. I don't think I'm doing anything myself with xref information. Browsing the source of PDF:WRITE-DOCUMENT and PDF:WRITE-OBJECT, it looks like all the xref information is manipulated under the hood. grep -a "xref" on my file indicates that it is writing these directive strings into the file. A sample broken file is available at http://www.quickhelp.org/debug/xref.pdf in case that would shed any light on the situation. Any suggestions would be greatly appreciated. Thanks, Andrew From marc.battyani at fractalconcept.com Sat Jan 22 02:28:24 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 22 Jan 2005 03:28:24 +0100 Subject: [cl-typesetting-devel] cl-typesetting documents with damaged xreftable References: <200501220122.j0M1MGgv008531@blombos.isi.edu> Message-ID: <03e501c5002a$0d653490$0a02a8c0@marcxp> "Andrew Philpot" wrote: > > I'm generating documents dynamically using cl-typesetting and then > serving them to a web browser. > > I'm doing something wrong, however. Some browsers' pdf plugins, and > some printer drivers as well, just give up. Linux xpdf complains > about my documents, although it usually displays them correctly. > The xpdf error message is > > Error (O): PDF file is damaged. Attempting to reconstruct XREF > table. [...] > Any suggestions would be greatly appreciated. The startxref is not set (same pb for the object indexes) startxref NIL %%EOF This is probably because you try to generate a pdf file directly into a socket stream for which get-file-position is not defined. You will have to write the file to a string with a with-output-to-string and then send the string to the socket-stream. Marc From tayss_temp2 at yahoo.com Mon Jan 24 21:11:12 2005 From: tayss_temp2 at yahoo.com (Tayssir John Gabbour) Date: Mon, 24 Jan 2005 13:11:12 -0800 (PST) Subject: [cl-typesetting-devel] cl-typesetting documents with damaged xreftable In-Reply-To: <03e501c5002a$0d653490$0a02a8c0@marcxp> Message-ID: <20050124211113.50810.qmail@web51905.mail.yahoo.com> Hi all, These Subversion diffs might be useful for anyone wanting to use cl-typesetting on CLisp-2.33.1/Win32. I hope I didn't boneheadedly break something, though I did test it out on examples. Notes: - pprint.lisp was modified because CLisp doesn't work well with Iterate. I've sent in a bugreport. I rewrote using loop instead. - Apparently CLisp-2.33.1 doesn't accept boxes.lisp's use of defgeneric syntax. I haven't yet sent in a bugreport. Hope to work more with cl-typesetting, Tayssir Index: specials.lisp =================================================================== --- specials.lisp (revision 80) +++ specials.lisp (working copy) @@ -4,9 +4,14 @@ (in-package typeset) -#+clisp +#+(and clisp win32) (setq custom:*floating-point-contagion-ansi* t custom:*warn-on-floating-point-contagion* nil + custom:*default-file-encoding* (ext:encoding-charset charset:iso-8859-1)) + +#+(and clisp (not win32)) +(setq custom:*floating-point-contagion-ansi* t + custom:*warn-on-floating-point-contagion* nil custom:*default-file-encoding* (ext:encoding-charset "iso-8859-1")) (defconstant +huge-number+ (truncate most-positive-fixnum 10)) Index: pprint.lisp =================================================================== --- pprint.lisp (revision 80) +++ pprint.lisp (working copy) @@ -46,25 +46,28 @@ (start 0) (trimmed 0) (length (length cleaned-line))) - (iter:iter - (setf trimmed (position #\Space cleaned-line :start start :test #'char/=)) - (while (and trimmed (< trimmed length))) - (for (values obj end) = (ignore-errors - (read-from-string - cleaned-line nil nil - :start trimmed :preserve-whitespace t))) - (unless (numberp end) - (setf end (position #\Space cleaned-line :start trimmed :test #'char=))) - (while (and (numberp end) (< end length))) - (cond ((keywordp obj) - (push (list* trimmed end *pp-keyword-decoration*) decorations)) - ((stringp obj) - (push (list* trimmed end *pp-string-decoration*) decorations)) - ((gethash obj *pp-symbol-decoration-table*) - (push (list* trimmed end (gethash obj *pp-symbol-decoration-table*)) decorations)) - ((and (symbolp obj)(eq (symbol-package obj) cl-package)) - (push (list* trimmed end *pp-common-lisp-decoration*) decorations))) - (setf start end)) + + + + (loop for trimmed = (setf trimmed (position #\Space cleaned-line :start start :test #'char/=)) + while (and trimmed (< trimmed length)) + for (values obj end) = (multiple-value-list (ignore-errors + (read-from-string + cleaned-line nil nil + :start trimmed :preserve-whitespace t))) + unless (numberp end) + do (setf end (position #\Space cleaned-line :start trimmed :test #'char=)) + while (and (numberp end) (< end length)) + do (cond ((keywordp obj) + (push (list* trimmed end *pp-keyword-decoration*) decorations)) + ((stringp obj) + (push (list* trimmed end *pp-string-decoration*) decorations)) + ((gethash obj *pp-symbol-decoration-table*) + (push (list* trimmed end (gethash obj *pp-symbol-decoration-table*)) decorations)) + ((and (symbolp obj)(eq (symbol-package obj) cl-package)) + (push (list* trimmed end *pp-common-lisp-decoration*) decorations))) + (setf start end)) + (setf start 0) (loop for (start-tok end-tok font-name color) in (nreverse decorations) do (when (/= start start-tok) Index: boxes.lisp =================================================================== --- boxes.lisp (revision 80) +++ boxes.lisp (working copy) @@ -166,15 +166,16 @@ (defmethod adjust-box-dy (box dy baseline) nil) -(defgeneric v-split ((box v-mode-mixin) dx dy) +;;(defgeneric v-split (v-mode-mixin dx dy)) + +(defmethod v-split ((box v-mode-mixin) dx dy) ;;; Split a v-mode box vertically into two parts ;; Args: dx - area width, dy - area height ;; Values: box-fitted, box-left, dy-left - (:method (box dx dy) (declare (ignore dx)) (if (> (dy box) dy) (values nil box dy) - (values box nil (- dy (dy box)))))) + (values box nil (- dy (dy box))))) (defgeneric boxes-left (content)) __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From marc.battyani at fractalconcept.com Mon Jan 24 22:36:31 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 24 Jan 2005 23:36:31 +0100 Subject: [cl-typesetting-devel] cl-typesetting documents with damagedxreftable References: <20050124211113.50810.qmail@web51905.mail.yahoo.com> Message-ID: <00aa01c50265$28203900$0a02a8c0@marcxp> "Tayssir John Gabbour" wrote: > These Subversion diffs might be useful for anyone wanting to use cl-typesetting > on CLisp-2.33.1/Win32. I hope I didn't boneheadedly break something, though I > did test it out on examples. Thanks for the patches, I will look at them. > Notes: > - pprint.lisp was modified because CLisp doesn't work well with Iterate. I've > sent in a bugreport. I rewrote using loop instead. I have a new version of Iterate to put in cl-pdf. > - Apparently CLisp-2.33.1 doesn't accept boxes.lisp's use of defgeneric syntax. > I haven't yet sent in a bugreport. IIRC This has already been fixed. > Hope to work more with cl-typesetting, Good idea! :) BTW I have lots of fixes, improvements and some new functionalities to put on the cl-typesetting repository. I'm really ashamed to not have been able to find the time to test and commit them. Hopefully this may change "real soon now" as I had a deadline for a traceability webapp to be presented at the "Traceability 2005" expo in Paris tomorrow and I just finished it now! Of course this application uses cl-typesetting and cl-pdf for the documents generation ;-) Marc From marc.battyani at fractalconcept.com Wed Jan 26 16:11:19 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 26 Jan 2005 17:11:19 +0100 Subject: [cl-typesetting-devel] cl-typesetting documents with damagedxreftable References: <20050124211113.50810.qmail@web51905.mail.yahoo.com> Message-ID: <05ea01c503c1$ad014440$0a02a8c0@marcxp> "Tayssir John Gabbour" wrote: > > These Subversion diffs might be useful for anyone wanting to use cl-typesetting > on CLisp-2.33.1/Win32. I hope I didn't boneheadedly break something, though I > did test it out on examples. > > Notes: > - pprint.lisp was modified because CLisp doesn't work well with Iterate. I've > sent in a bugreport. I rewrote using loop instead. [...] > + (loop for trimmed = (setf trimmed (position #\Space cleaned-line :start > start :test #'char/=)) > + while (and trimmed (< trimmed length)) > + for (values obj end) = (multiple-value-list (ignore-errors Well this is one of the reason I don't use LOOP for complex loop now: You can't put a WHILE before a FOR. It seems a silly design decision for LOOP but it's real and some LOOP implementations really don't work in such a case. So your loop is a non conforming program :( Have you tried a recent ITERATE version ? There have been several fixes for clisp IIRC. Marc From marc.battyani at fractalconcept.com Wed Jan 26 22:04:56 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 26 Jan 2005 23:04:56 +0100 Subject: [cl-typesetting-devel] cl-pdf repository update Message-ID: <074c01c503f3$13b432c0$0a02a8c0@marcxp> I've commited the latest modifications to the cl-pdf repository. Rev81: Added PNG image support (see png-example) [Thanks to Dmitri Ivanov] Updated ITERATE with Jorg Hohle's fixes. The full repository is here: http://www.fractalconcept.com:8000/public/open-source/ (It's a subversion 1.0 repository.) The cl-pdf part: http://www.fractalconcept.com:8000/public/open-source/cl-pdf/ The cl-typesetting part: http://www.fractalconcept.com:8000/public/open-source/cl-typesetting/ The mod_lisp part: http://www.fractalconcept.com:8000/public/open-source/mod_lisp/ There are also tarballs for cl-pdf and cl-typesetting: http://www.fractalconcept.com/download/cl-pdf-current.tgz http://www.fractalconcept.com/download/cl-typesetting-current.tgz BTW the (somewhat outdated) home pages for these projects are here: http://www.fractalconcept.com/asp/html/cl-pdf.html http://www.fractalconcept.com/asp/html/cl-typesetting.html http://www.fractalconcept.com/asp/html/mod_lisp.html Marc From marc.battyani at fractalconcept.com Thu Jan 27 23:05:04 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 28 Jan 2005 00:05:04 +0100 Subject: [cl-typesetting-devel] Re: [cl-pdf-devel] cl-pdf repository update References: <074c01c503f3$13b432c0$0a02a8c0@marcxp> Message-ID: <020b01c504c4$a4244a30$0a02a8c0@marcxp> I wrote: > I've commited the latest modifications to the cl-pdf repository. Well, sorry, I just forgot to publish the new repository on the server... :( It's OK now. Marc > Rev81: > > Added PNG image support (see png-example) [Thanks to Dmitri Ivanov] > > Updated ITERATE with Jorg Hohle's fixes. > > > The full repository is here: > http://www.fractalconcept.com:8000/public/open-source/ > (It's a subversion 1.0 repository.) > > The cl-pdf part: > http://www.fractalconcept.com:8000/public/open-source/cl-pdf/ > > The cl-typesetting part: > http://www.fractalconcept.com:8000/public/open-source/cl-typesetting/ > > The mod_lisp part: > http://www.fractalconcept.com:8000/public/open-source/mod_lisp/ > > There are also tarballs for cl-pdf and cl-typesetting: > > http://www.fractalconcept.com/download/cl-pdf-current.tgz > > http://www.fractalconcept.com/download/cl-typesetting-current.tgz > > BTW the (somewhat outdated) home pages for these projects are here: > http://www.fractalconcept.com/asp/html/cl-pdf.html > http://www.fractalconcept.com/asp/html/cl-typesetting.html > http://www.fractalconcept.com/asp/html/mod_lisp.html > > Marc > > _______________________________________________ > cl-pdf-devel site list > cl-pdf-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-pdf-devel >