File: corman-readme.txt

package info (click to toggle)
cl-pdf 166-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,520 kB
  • ctags: 639
  • sloc: lisp: 6,902; makefile: 39
file content (78 lines) | stat: -rw-r--r-- 2,348 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
[the following works as of September 12, 2004] 

Apply the latest patches available at www.cormanlisp.com, and
recompile Corman Lisp as explained in the manual (page 23)

Install ASDF as explained at http://www.weitz.de/corman-asdf/

A few changes are required to make cl-pdf work on Corman Lisp (the
following assumes that it's installed at c:/cl-pdf)

* Patch iterate.lisp (c:/cl-pdf/iterate/iterate.lisp)

 453c453 
 <   (set-dispatch-macro-character #\# #\L 'sharpL-reader) 
 --- 
 >   (set-dispatch-macro-character #\# #\L #'sharpL-reader)
 1312c1312 
 < (eval-when (:compile-toplevel :load-toplevel) 
 --- 
 > (eval-when (:compile-toplevel :load-toplevel :execute)
 1758c1758 
 <     (coerce #\null type)) 
 --- 
 >     (coerce #\nul type))
 3435c3435 
 <   (when *old-sharpl-func* 
 --- 
 >   (when (and (boundp '*old-sharpL-func*) *old-sharpL-func*)

* Make sure corman-patches.lisp is loaded at the beginning and
  corman-patches-2.lisp is loaded at the end (modify
  c:/cl-pdf/cl-pdf.asd as follows):

 29c29,31
 <              (:file "config" :depends-on ("defpackage"))
 ---
 >              #+cormanlisp (:file "corman-patches")
 >              #+cormanlisp (:file "corman-patches-2" :depends-on ("pdf-base"))
 >              (:file "config" :depends-on ("defpackage" #+cormanlisp "corman-patches"))

* cl-pdf is ready to be used:

(load "y:/cl-pdf/cl-pdf.asd")

(asdf:oos 'asdf:load-op :cl-pdf)

* You can test the examples

(load "y:/cl-pdf/examples/examples.lisp")

(progn
 (example1 #P"c:/ex1.pdf") 
 (example2 #P"c:/ex2.pdf") 
 (example3 #P"c:/ex3.pdf") 
 (example4 #P"c:/ex4.pdf") 
 (example5 50 50 :file #P"c:/ex5.pdf") 
 (example6 #P"c:/ex6.pdf")
 (example7 #P"c:/ex7.pdf"))

There is a problem with the image in the last example. cl-pdf
generates text files, and Corman Lisp expands line feeds
(#\Newline->CR/LF) breaking binary fragments (images and compressed
parts).

If you want to enable compression or import image files, you need to
use the pdf::with-binary-files macro, that redefines temporarily the
function expand-line-feeds to avoid the expansion.

(setf pdf::*compress-streams* t)

(pdf::with-binary-files 
 (example1 #P"c:/ex1.pdf") 
 (example2 #P"c:/ex2.pdf") 
 (example3 #P"c:/ex3.pdf") 
 (example4 #P"c:/ex4.pdf") 
 (example5 50 50 :file #P"c:/ex5.pdf") 
 (example6 #P"c:/ex6.pdf")
 (example7 #P"c:/ex7.pdf"))