<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.lisp.cl-pdf.devel">
    <title>gmane.lisp.cl-pdf.devel</title>
    <link>http://blog.gmane.org/gmane.lisp.cl-pdf.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/55"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/54"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/53"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/52"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/51"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/50"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/49"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/48"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/47"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/46"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/45"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/44"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/43"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/42"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/41"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/40"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/39"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/38"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/37"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/36"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/55">
    <title>Re: gradients</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/55</link>
    <description>&lt;pre&gt;

Hi,

Gradients of this sort are called shading patterns in PDF (available 
from PDF version 1.3). Several types of shading patterns are available: 
function-based, axial, radial, Gourad-shaded. cl-pdf doesn't have any 
support for this, but it shouldn't be very hard to add.

The PDF specification is available from

    http://www.adobe.com/devnet/pdf/pdf_reference_archive.html

You want section 4.6.3.

&lt;/pre&gt;</description>
    <dc:creator>Eric Marsden</dc:creator>
    <dc:date>2012-04-19T07:17:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/54">
    <title>gradients</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/54</link>
    <description>&lt;pre&gt;Hi,

I would like to write a plotting function that draws image plots
(plotting a matrix in 2d using colors).  It would be useful to use
gradients; in particular, paint a rectangle where the four corners each
have a color and the each point in the rectangle has a color which is a
convex combination of the corner colors.  I think this is called a
gradient in most libraries, but I could not figure out how to do it in
cl-pdf (I have to admit that I didn't find gradients in the library,
maybe I didn't look hard enough).  Suggestions/examples would be
welcome.

Best,

Tamas

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Tamas K Papp</dc:creator>
    <dc:date>2012-04-18T08:17:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/53">
    <title>Re: embedding PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/53</link>
    <description>&lt;pre&gt;
pdf-templates.lisp has code to print pages extracted from a pdf to some
position/size on a new page. Here is the example from this file:

;;;## Example Usage
;;; Try something like this after loading pdf-template.lisp:
;;;
;;; (pdf:test-template "/tmp/ex7.pdf" 1 "/tmp/template.pdf")

(defun test-template (in-file page-number out-file)
  "Create a new PDF with the given file and page number drawn several
times.  This test requires pdf-parser to be loaded."
  (let* ((old-doc (read-pdf-file in-file))
         (old-root (root-page old-doc))
         (old-page (aref (pages old-root) page-number))
         (old-page-bounds (or (resolve-page-dict-value (content
old-page) "/MediaBox")
                              *default-template-size*))
         (width (svref old-page-bounds 2))
         (height (svref old-page-bounds 3)))
    (with-document ()
      (with-page (:bounds old-page-bounds)
        (let ((top-template (make-template-from-page
                             old-page :scale 2/5 :translate-x (* 3/10 width)
                             :translate-y (* 3/5 height)))
              (right-template (make-template-from-page
                               old-page :scale 2/5 :rotate 90
                               :translate-x (* 3/5 width) :translate-y
(* 3/10 height)))
              (left-template (make-template-from-page
                              old-page :scale 2/5 :rotate -90
                              :translate-y (* 3/10 height )))
              (bottom-template (make-template-from-page
                                old-page :scale 2/5 :rotate 180
                                :translate-x (* 3/10 width))))
          (add-templates-to-page top-template right-template
                                 left-template bottom-template)
          (draw-template top-template)
          (draw-template bottom-template)
          (draw-template left-template)
          (draw-template right-template)))
      (write-document out-file))))

Marc

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Marc Battyani</dc:creator>
    <dc:date>2012-02-12T17:17:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/52">
    <title>Re: embedding PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/52</link>
    <description>&lt;pre&gt;
I haven't played with this, but, looking at the cl-pdf source, I see a file name pdf-parser.lisp, containing intriguiing function names like read-pdf and insert-original-page-content.

Read through and try out the #|'ed out test section at the bottom of the file.

It helps to know a bit about the internal structure of a pdf document.

There are also various command-line tools - google for "pdf merge", "pdf tools", "pdf parser", etc.

pt

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Paul Tarvydas</dc:creator>
    <dc:date>2012-02-12T16:35:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/51">
    <title>Re: embedding PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/51</link>
    <description>&lt;pre&gt;Tamas Papp wrote on Sun, 12 Feb 2012 12:04:26 +0100 15:04:

| Is it possible to embed another PDF file (ie render it contents at a
| particular coordinate) in a document generated by CL-PDF?

You can embed any file as a binary object and specify the corresponding MIME
type for it. I am not sure about the way a typical PDF viewer will render
such an embedded PDF file. In all probability, the viewer will open it in
another window.

OTOH, you could parse the emended file and include its contents as you
wanted.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Dmitriy Ivanov</dc:creator>
    <dc:date>2012-02-12T15:36:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/50">
    <title>embedding PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/50</link>
    <description>&lt;pre&gt;Hi,

Is it possible to embed another PDF file (ie render it contents at a
particular coordinate) in a document generated by CL-PDF?

Thanks,

Tamas

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Tamas Papp</dc:creator>
    <dc:date>2012-02-12T11:04:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/49">
    <title>Need help with layout</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/49</link>
    <description>&lt;pre&gt;I'm having some issues getting my layout working, and I'm running out of
time, so if anyone can help, I'd appreciate it.

How can I have a line of text, a user drawn box, and another line of text,
with the text lined up pretty much with the center of the box?  I have a
100 point high user draw box, so I need label text on the left and right
about 50 points from the top or bottom of the box.

Can anyone help?


_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-18T18:28:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/48">
    <title>Text to left and right of user drawn box</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/48</link>
    <description>&lt;pre&gt;I'm drawing a chart that needs text to the left and the right.  However,
I'm not sure which text methods are correct within the context of
WITH-DOCUMENT to place text where I need them to go.  Using the regular
CL-PDF methods causes an error, because *page* is not set.



_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-18T18:12:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/47">
    <title>Adding arrow heads to lines</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/47</link>
    <description>&lt;pre&gt;Is there a way to add arrow heads without trying to rotate and draw them
manuall?


_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-17T12:46:20</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/46">
    <title>Importing Cambria font</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/46</link>
    <description>&lt;pre&gt;I'm running SBCL on OS X.  How could I import a Cambria font for use in PDFs?


_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-17T12:48:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/45">
    <title>Multicolor text in paragraph</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/45</link>
    <description>&lt;pre&gt;Can PARAGRAPH be used to show different styles/colors of text in the same
line?



_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-15T14:08:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/44">
    <title>More questions</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/44</link>
    <description>&lt;pre&gt;1.  What does with-saved-state do?  I've tried changing color inside this
expression, and expecting it to go back to what it was before after the
expression ends.  Is this how it works?

2.  I tried changing the fill and stroke colors for text on one line, and
then a different color on the next line.  But all text on the page ends up
the last color I use.  How can I have different color text?

3.  What are the uses for in-text-mode and move-text ?  I tried move-text
while inside in-text-mode, and it seems to have no effect on the text
location.  move-to does not either.  But vspace does.




_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-12T01:31:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/43">
    <title>Understanding text layout functions</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/43</link>
    <description>&lt;pre&gt;I'm trying to draw a title page, with some colored bars and images, and
text as well.

What is the purpose of in-text-mode and draw-text versus the paragraph
function?

Why do some strings appear correctly in the pdf when they are in a
paragraph, but others need to be inserted with format-string?

I have more questions, but I'll start with these.


_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2012-01-11T23:37:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/42">
    <title>Re: Bullet points</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/42</link>
    <description>&lt;pre&gt;jcm-B3LF187vQQA&amp;lt; at &amp;gt;public.gmane.org wrote on Thu, 29 Dec 2011 01:22:45 -0000 05:22:

| I'm back on a major project using cl-pdf.  I need to generate bullet
| points in a table display.  I've been experimenting with UTF-8 encoding
| in other areas, but not cl-pdf.  What's the trick to displaying them?

I believe CL-PDF does not support UTF-8 directly. Your can
- either reencode in Unicode (UTF-2),
- or split your text to exploit several one-byte encodings.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Dmitriy Ivanov</dc:creator>
    <dc:date>2011-12-29T06:19:20</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/41">
    <title>Bullet points</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/41</link>
    <description>&lt;pre&gt;Hi all,

I'm back on a major project using cl-pdf.  I need to generate bullet
points in a table display.  I've been experimenting with UTF-8 encoding in
other areas, but not cl-pdf.  What's the trick to displaying them?



_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>jcm-B3LF187vQQA&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2011-12-29T01:22:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/40">
    <title>Re: Conversion of TrueType fonts to afm for use by CL-PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/40</link>
    <description>&lt;pre&gt;  Wow. Thanks. I've been struggling with that for quite a while.

Mitch

On 11/15/2011 2:20 PM, Andrey Moskvitin wrote:

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Mitch Berkson</dc:creator>
    <dc:date>2011-11-15T23:49:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/39">
    <title>Re: Conversion of TrueType fonts to afm for use byCL-PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/39</link>
    <description>&lt;pre&gt;
http://lists.common-lisp.net/pipermail/cl-pdf-devel/2006-March/001008.html

Andrey

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Andrey Moskvitin</dc:creator>
    <dc:date>2011-11-15T19:20:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/38">
    <title>Conversion of TrueType fonts to afm for use by CL-PDF</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/38</link>
    <description>&lt;pre&gt;I have tried two ways to convert my Garamond TrueType font to .afm.  The 
first was using the font converter at http://fpdf.fruit-lab.de/. The 
second was using Dimitriy's converter ttf2pt1.

When viewing a pdf document created using the Garamond.afm font produced 
by either of these, Adobe reader says "The font 'Garamond' contains a 
bad /BBox." and the text looks bad.

Is there a better way to get .afm files for CL-PDF?  Thanks for any help.

Mitch Berkson

I doubt if this is an issue, but to generate the pdf, I am using:

(defun font-test (&amp;amp;optional (file (merge-pathnames  "font-test.pdf" *dir*)))
   (pdf:with-document ()
     (pdf:with-page ()
       (let ((font-names '("Helvetica" "Times-Roman" "Garamond"))
             (text-str "Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. Nam elit metus,
consequat ac posuere eu, rutrum sit amet nisi. Suspendisse potenti. In 
consequat, massa sit amet
eleifend pharetra, ligula nisl posuere elit, aliquam sagittis nibh magna 
eget justo. Maecenas
justo risus, varius at iaculis in, pellentesque at lectus. Praesent ut 
tincidunt lectus.")
             (content))
         (loop for a-font-name in font-names
               for i from 0
               do (setf content
                        (tt:compile-text ()
                          (tt:paragraph (:h-align 'left
                                         :font (pdf:get-font a-font-name)
                                         :font-size 12
                                         :color (pdf:set-cymk-stroke 0.0 
0.0 0.0 100.0))
                            (tt:verbatim (format nil "~a~%~a" 
a-font-name text-str)))))
               do (tt::draw-block content 50 (- 700 (* 100 i)) 500 500))))
     (pdf:write-document file)))

_______________________________________________
cl-pdf-devel site list
cl-pdf-devel-F1HGIaG5STRyXAeb93iumQ&amp;lt; at &amp;gt;public.gmane.org
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

&lt;/pre&gt;</description>
    <dc:creator>Mitch Berkson</dc:creator>
    <dc:date>2011-11-15T18:11:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/37">
    <title>Re: Some problems with pdf-parser</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/37</link>
    <description>&lt;pre&gt;Some corrections to previous post

Ad 2. In file cl-pdf, function make-indirect-object

This code seems to work for me correcting unexpected behaviour
but I am not sure it is correct in every case (added some formats for 
debugging):

(defun make-indirect-object (obj-number gen-number position)
   (let ((object (gethash (cons obj-number gen-number) *indirect-objects*)))
     (if object
     (progn
       (format T "obj alredy present: ~s ~s at position ~s" obj-number 
gen-number(cdr object))
       (if (zerop (cdr object)) ; some objects are created and marked 
with invalid position = 0
           (progn
         (format T " (marked for update with position=0), update 
position to ~s~%" position)
         (setf (gethash (cons obj-number gen-number) *indirect-objects*)
               (cons (car object) position)))
            (format T " (dropped older one at position ~s)~%" position))
         (car object))
     (progn
       (format T "making obj: ~s ~s position ~s ~%" obj-number 
gen-number position)
       (let ((new-object (make-instance 'indirect-object
                        :obj-number obj-number
                        :gen-number gen-number
                        :content :unread
                        :no-link t)))
         (setf (gethash (cons obj-number gen-number) *indirect-objects*) 
(cons new-object position))
         new-object)))))

Now order of reading example file is as follow:

startxref position: 89502
xref position: 89502
making obj: 4 0 position 85386
making obj: 5 0 position 89106
making obj: 8 0 position 89309
making obj: 7 0 position 0
xref position: 116
making obj: 6 0 position 16
obj alredy present: 7 0 at position 0 (marked for update with 
position=0), update position to 1150
obj alredy present: 8 0 at position 89309 (dropped older one at position 
1227)
making obj: 9 0 position 1411
making obj: 10 0 position 1554
(...)
making obj: 37 0 position 936
xref position: 85210
making obj: 1 0 position 81250
making obj: 2 0 position 81284
making obj: 3 0 position 81308
obj alredy present: 4 0 at position 85386 (dropped older one at position 
81359)
obj alredy present: 5 0 at position 89106 (dropped older one at position 
85007)


Please ignore this, I misread this function, it seems ok.


&lt;/pre&gt;</description>
    <dc:creator>Piotr Chamera</dc:creator>
    <dc:date>2011-06-10T18:12:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/36">
    <title>Some problems with pdf-parser</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/36</link>
    <description>&lt;pre&gt;Hi,
I just started with cl-pdf and it works great for me :)
but I found some problems in pdf-parser and need advice
how to fix it. I am rather novice Lisper so I can be wrong
in my guesses below...


1. In file cl-pdf, function find-cross-reference-start

function searches for 'startxref' in buffer _from beginning_
and can find incorrect place if at end of file (in buffer)
are two such sections (eg small incremental change at end of file).

Proposition: change

     (let ((position (search "startxref" buffer)))

to

     (let ((position (search "startxref" buffer :from-end t)))



2. In file cl-pdf, function make-indirect-object:

(defun make-indirect-object (obj-number gen-number position)
   (let ((object (or (car (gethash (cons obj-number gen-number) 
*indirect-objects*))
    (make-instance 'indirect-object
   :obj-number obj-number
   :gen-number gen-number
   :content :unread
   :no-link t))))
     (setf (gethash (cons obj-number gen-number) *indirect-objects*) 
(cons object position))
     object))

I am working on file generated from Adobe Acrobat Distiller
and then cropped in Adobe Acrobat so at end of file there are
few modified objects with duplicate numbers (and generations â��
whih is maybe bug in Acrobat?). When indirect-object objects
are read from file (in order from cross reference tables which
a read from newest to oldest) then newer one are overwritten
by older one with the same number. We end with readable pdf
but with some object revisions dropped.

I have added some print for debuggind in above function (and some
others) and for sample file got such a reading order:

startxref position: 89502
xref position: 89502
making obj: 4 0 position 85386
making obj: 5 0 position 89106
making obj: 8 0 position 89309
making obj: 7 0 position 0
xref position: 116
making obj: 6 0 position 16
making obj: 7 0 position 1150
making obj: 8 0 position 1227
making obj: 9 0 position 1411
making obj: 10 0 position 1554
(..)
making obj: 37 0 position 936
xref position: 85210
making obj: 1 0 position 81250
making obj: 2 0 position 81284
making obj: 3 0 position 81308
making obj: 4 0 position 81359
making obj: 5 0 position 85007

Which shows that in file are 4 duplicated objects and
they are overwritten by older versions (4 0, 5 0, 8 0, 7 0).


I think that solution would be to drop older objects when
newer wersion with the same number and generation was already read?
Something like this:

(defun make-indirect-object (obj-number gen-number position)
   (let ((object (gethash (cons obj-number gen-number) *indirect-objects*)))
     (if object
(progn
  (format T "obj alredy present: ~s ~s at position ~s (dropped older 
one at position ~s)~%"
  obj-number gen-number
  (cdr object) position)
  (car object))
(progn
  (format T "making obj: ~s ~s position ~s ~%" obj-number gen-number 
position)
  (let ((new-object (make-instance 'indirect-object
   :obj-number obj-number
   :gen-number gen-number
   :content :unread
   :no-link t)))
    (setf (gethash (cons obj-number gen-number) *indirect-objects*) 
(cons new-object position))
    new-object)))))

Which gives on the same example file

startxref position: 89502
xref position: 89502
making obj: 4 0 position 85386
making obj: 5 0 position 89106
making obj: 8 0 position 89309
making obj: 7 0 position 0
xref position: 116
making obj: 6 0 position 16
obj alredy present: 7 0 at position 0 (dropped older one at position 1150)
obj alredy present: 8 0 at position 89309 (dropped older one at position 
1227)
making obj: 9 0 position 1411
making obj: 10 0 position 1554
(...)
making obj: 37 0 position 936
xref position: 85210
making obj: 1 0 position 81250
making obj: 2 0 position 81284
making obj: 3 0 position 81308
obj alredy present: 4 0 at position 85386 (dropped older one at position 
81359)
obj alredy present: 5 0 at position 89106 (dropped older one at position 
85007)



But this reveals another problem in read-xref-and-trailer

(defun read-xref-and-trailer (position)
   (let (first-trailer)
     (loop
        (format T "xref position: ~s~%" position)
        (read-cross-reference-subsections position)
        (let* ((trailer (read-trailer)))
 (unless first-trailer (setf first-trailer trailer))
 (let ((prev-position (get-dict-value trailer "/Prev")))
   (if prev-position
       (setq position prev-position)
       (return first-trailer)))))))

If I correctly read it, it reads trailers from most recent to older
and returns oldest instead of first read? So in read-pdf document gets 
incorrect information.

Can someone rewiew above and tell me if I search in good direction
or I am entirely wrong...


&lt;/pre&gt;</description>
    <dc:creator>Piotr Chamera</dc:creator>
    <dc:date>2011-06-10T16:48:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/35">
    <title>Re: source file character encodings</title>
    <link>http://permalink.gmane.org/gmane.lisp.cl-pdf.devel/35</link>
    <description>&lt;pre&gt;

fyi, i got rid of the non-ascii characters and comitted the change to svn.

&lt;/pre&gt;</description>
    <dc:creator>Attila Lendvai</dc:creator>
    <dc:date>2011-03-28T00:09:12</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.lisp.cl-pdf.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.lisp.cl-pdf.devel</link>
  </textinput>
</rdf:RDF>

