From: KURODA Hisao

Subject: Re: Postscript pictures???

Date: 2000-10-19 6:09

Hello,

"Keith L. Downing" <ifi.ntnu.no at keithd> writes:

>   I'm probably dreaming, but is there any possibility for easily generating > postscript (or other common formats) from a standard Allegro graphics > > session?
Not from a standard Allegro graphics session, but I used ClibPDF202 through ACL501's FFI for my latest project. It works fine on Sun/Solaris and Windows. Sample lisp code(converted from original C code) is like follows. If you have any interest, I could send you my FFI definitions. though ClibPDF is not a free software. /* dashtest.c -- Test program for dashes * Copyright (C) 1998, 1999 FastIO Systems, All Rights Reserved. * For conditions of use, license, and distribution, see LICENSE.pdf * included in the distribution or http://www.fastio.com/LICENSE.pdf ;;; -*- lisp -*- (defpackage :cpdf) (in-package :cpdf) (defconstant *dashtest-id* "$Id: dashtest.cl,v 1.2 2000/06/26 11:14:25 kuroda Exp $") (defvar dashpattern '("[2 2] 0" "[4 4] 0" "[8 8] 0" "[8 8] 4" "[8 8] 8" "[12 4] 0" "[16 3 4 3] 0" "[13 3 2 3 2 3] 0" "[ ] 0" )) (defvar Ndash 9) (defvar ybump 0.22) (defvar x 1.0) (defvar y 3.0) (defvar fontsize 12.0) (let ((pdf (cpdf-open 0 *null*))) (cpdf-enable-Compression pdf *YES*) ;/* use Flate/Zlib compression */ (cpdf-init pdf) (cpdf-page-Init pdf 1 *PORTRAIT* *LETTER* *LETTER*) ;/* page orientation */ (cpdf-translate pdf 0.0 6.5) (cpdf-setgray pdf 0.0) (dotimes (i Ndash) (cpdf-setdash pdf (nth i dashpattern)) (cpdf-moveto pdf x y) (cpdf-lineto pdf (+ x 2.0) y) (cpdf-stroke pdf) (setq y (- y ybump)) ) (setq x 3.1) (setq y (- 3.0 (/ (* fontsize 0.3) *inch*))) (cpdf-begin-Text pdf 0) (cpdf-set-Font pdf "Helvetica" "MacRomanEncoding" fontsize) (dotimes (i Ndash) (cpdf-text pdf x y 0.0 (nth i dashpattern)) ;/* cpdf_text() may be repeatedly used */ (setq y (- y ybump)) ) (cpdf-end-Text pdf) (cpdf-finalize-All pdf) ;/* PDF file/memstream is actually written here */ (cpdf-save-PDF-memory-Stream-To-File pdf "dashtest.pdf") (cpdf-close pdf) (cpdf-launch-Preview pdf) ) --- (define (KURODA Hisao) (email <msi.co.jp)) at kuroda>