From marc.battyani at fractalconcept.com Mon Sep 5 20:53:03 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 5 Sep 2005 22:53:03 +0200 Subject: [cl-pdf-devel] [ANNOUNCE] cl-pdf-parser References: <05b701c54f58$f49ec790$0a02a8c0@marcxp> <3399eb317bb77127e8de9b85b29d6248@gmail.com> Message-ID: <042601c5b25b$cfec5ff0$0a02a8c0@marcxp> Hi Luis, >I was just looking for something like this and read this announcement >in the mailing list archives. Good stuff! Thanks :) >I have a question though. Is it possible to take a couple of pages in >some document, modify them (scaling, rotating, adding content, etc..) >and then draw them in another document's page? If so, any hints would >be most appreciated. If not, what functionality is missing? Sure it's possible: You open a page with with-existing-page then you draw on it, you can also rotate, translate, scale, etc. then you call #'insert-original-page-content to insert the original content of the page. and after that you can write again on the page. If you want to write the content of another page then you have to look at how insert-original-page-content is implemented and modify it by adding an optional page number so that you can insert the content of a specified page instead of the current one. If the page uses resources like fonts, XObjects, etc. you have to copy them to the local page resources. When you have finished it, don't forget to send it to me so that I can put it in cl-pdf-parser. ;-) Cheers, Marc From luismbo at gmail.com Mon Sep 5 19:40:09 2005 From: luismbo at gmail.com (Luis Oliveira) Date: Mon, 5 Sep 2005 20:40:09 +0100 Subject: [cl-pdf-devel] [ANNOUNCE] cl-pdf-parser In-Reply-To: <05b701c54f58$f49ec790$0a02a8c0@marcxp> References: <05b701c54f58$f49ec790$0a02a8c0@marcxp> Message-ID: <3399eb317bb77127e8de9b85b29d6248@gmail.com> On 24/jun/2005, at 13:36, Marc Battyani wrote: > This is the first public release of cl-pdf-parser. > cl-pdf-parser enables cl-pdf to draw on existing pages and add new > pages to > an existing PDF document. Hello, I was just looking for something like this and read this announcement in the mailing list archives. Good stuff! I have a question though. Is it possible to take a couple of pages in some document, modify them (scaling, rotating, adding content, etc..) and then draw them in another document's page? If so, any hints would be most appreciated. If not, what functionality is missing? Thanks, -- Lu?s Oliveira http://student.dei.uc.pt/~lmoliv/ Equipa Portuguesa do Translation Project http://www2.iro.umontreal.ca/~pinard/po/registry.cgi?team=pt From levente.meszaros at mailbox.hu Sat Sep 24 21:30:26 2005 From: levente.meszaros at mailbox.hu (=?utf-8?Q?Levente_M=C3=A9sz=C3=A1ros?=) Date: Sat, 24 Sep 2005 23:30:26 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 Message-ID: Hello, I'm new to this list and to both cl-pdf and cl-typesetting, and unforunately I could really use some help. Until now I was using docbook and XSLT processors for generating documents, but I found out that it is a bad solution (and well I was really kind saying this), so I decided to use lisp. I'm hungarian guy and I would like to generate documents in my national language. I tried really hard, but I could not manage to generate a pdf file with unicode (or iso-8859-2) characters in it, although all tests shipped with the packages worked very well. I have attached a unicode xml file which I was trying to use as an example and a small program which I was hacking with. I'm using the newest clisp under cygwin and windows XP. I have patched deflate-stream-interface.lisp not to use ASCII encoding, but utf-8. Perhaps I was wrong on this: 77c77 < (ext:convert-string-to-bytes string charset:ascii :start start :end end) --- > (ext:convert-string-to-bytes string charset:utf-8 :start start :end end) Unfortunately I get error messages like: *** - AREF: index 337 for #(# # # # # <2> # <3> # <4> # <5> # <6> # <7> # <8> # <9> # <10> # 1 <11> # <12> # <13> # and while loading some fonts I get: (AND (= (AREF PDF::DATA PDF::START) PDF::+PFB-MARKER+) (= (AREF PDF::DATA (1+ PDF::START)) PDF::MARKER)) must evaluate to a non-NIL value. stack: <1> # <2> # <3> # <4> # <5> # <6> # <7> # <8> # <9> # <10> # 1 <11> # <12> # <13> # EVAL frame for form (SETQ *FONT* (PDF:LOAD-T1-FONT "~/MonospaceRoman.afm" "~/MonospaceRoman.pfa")) <14> # EVAL frame for form (LOAD "~/document.lisp") <15> # <16> # and the worst is sometimes segfault... Could somebody help me and show how could I generate a document with that text or with any central european or unicode (utf-8) text? And is there any documentation of cl-pdf and cl-typesetting? I mean other than the source code? I also had problems running kw-extensions.lisp examples. They produce empty documents, but I would really need something like that. It looks much closer to what docbook offers and still I get all the flexibility of the framework and lisp. Thank you for reading this letter... ;-) Regards, levy -------------- next part -------------- A non-text attachment was scrubbed... Name: document.xml.utf Type: application/octet-stream Size: 135 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: document.lisp Type: application/octet-stream Size: 3127 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Sun Sep 25 08:53:08 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 25 Sep 2005 10:53:08 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 References: Message-ID: <06a601c5c1ae$8e2d7060$0a02a8c0@marcxp> "Levente M?sz?ros" wrote: Hi Levy, >I'm new to this list and to both cl-pdf and cl-typesetting, and unforunately >I could really use some help. Until now I was using docbook and XSLT >processors for generating documents, but I found out that it is a bad >solution (and well I was really kind saying this), so I decided to use lisp. Good decision! ;-) >I'm hungarian guy and I would like to generate documents in my national >language. I tried really hard, but I could not manage to generate a pdf file >with unicode (or iso-8859-2) characters in it, although all tests shipped >with the packages worked very well. There is no Unicode support in cl-pdf yet. So for now, you need to use the iso-8859-2 character set. If the characters in this charset are already in the PDF standard fonts, then you just have to provide the encoding. (see encodings.lisp) Otherwise you need to provide the font. >I have attached a unicode xml file which I was trying to use as an example >and a small program which I was hacking with. I'm using the newest clisp >under cygwin and windows XP. >I have patched deflate-stream-interface.lisp not to use ASCII encoding, but >utf-8. Perhaps I was wrong on this: >77c77 >< (ext:convert-string-to-bytes string charset:ascii :start start :end end) >--- >> (ext:convert-string-to-bytes string charset:utf-8 :start start :end end) OK but it will not be enough. While troubleshooting this kind of stuff, you should disable compression completely to avoid 2 kinds of problems at the same time. >Unfortunately I get error messages like: >*** - AREF: index 337 for #(# #and the worst is sometimes segfault... > >Could somebody help me and show how could I generate a document with that >text or with any central european or unicode (utf-8) text? Yes, you should look at Dmitri Ivanov's web page on cl-pdf where he has an example of the use of cl-pdf with Cyrillic fonts: http://lisp.ystok.ru/cl-pdf.html http://lisp.ystok.ru/code/ex-1251.pdf >And is there any documentation of cl-pdf and cl-typesetting? I mean other >than the source code? Unfortunately not yet. There have been some attempts at it but nothing really finished. The lack of documentation of cl-pdf/cl-typesetting is a problem but each time I can manage to find some time to work on them I prefer to write some new functionality, like Unicode support for instance, rather than some doc. ;-) At least I should add some more examples. So if anybody has small self contained examples, I would be happy to add them to the repositories. >I also had problems running kw-extensions.lisp examples. They produce empty >documents, but I would really need something like that. It looks much closer >to what docbook offers and still I get all the flexibility of the framework >and lisp. >Thank you for reading this letter... ;-) You're welcome :) Marc From marc.battyani at fractalconcept.com Sun Sep 25 15:48:19 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 25 Sep 2005 17:48:19 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 References: Message-ID: <07c701c5c1e8$8e7ff0d0$0a02a8c0@marcxp> "Levente M?sz?ros" wrote: >I have switched to iso-8859-2, created a new encoding as you suggested and >it almost works. Unfortunately the glyphs for ohungarumlaut, uhungarumlaut, >Ohungarumlaut, Uhungarumlaut have problems with their sizes (Times-Roman). >Could you give me a hint what to do? I have tried everything I could and now >I'm run out of ideas. Well, it seems that there is a problem with the encoding in the pdf file. In the attached one, the text in win-ansi is OK but the one in iso-8859 is not. The sizes are computed correctly though. I will look at this Marc -------------- next part -------------- A non-text attachment was scrubbed... Name: document.pdf Type: application/pdf Size: 2773 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Sun Sep 25 18:08:32 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 25 Sep 2005 20:08:32 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 References: Message-ID: <087201c5c1fc$247cdf90$0a02a8c0@marcxp> "Levente M?sz?ros" wrote: >I got the same result when I was using win-ansi. The glyphs look good in the >second row of the file you have sent, but the positions... I've checked the generated pdf file and the encoding encoding (if I can say so ;-) and it seems ok for me. Can you generate the same small pdf file with another tool and send it to me so that I can compare the way the encoding is encoded ? >BTW: do you have some hungarian relatives? I'm asking because your name is >quite close to a famous hungarian earl called Lajos Batthy?ni. Yes, my grand father was Hungarian and his name was Lajos Batthy?ni too, though it's probably not the one you think of. The h was dropped by the French administration when he came in France :(. Sadly he died before I was born so I don't have much information on him. BTW I'm going to visit Budapest on October 24-28 :-) Marc From marc.battyani at fractalconcept.com Mon Sep 26 09:36:14 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 26 Sep 2005 11:36:14 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 References: Message-ID: <009801c5c27d$bddaf0b0$0a02a8c0@marcxp> "M?sz?ros Levente" wrote: >Here are two versions generated with Jaws PDF creator and PDF Creator >"whatever". >In x.pdf I saw something like: ><1/odblacute/udblacute/Odblacute/Udblacute]>> >endobj >I think this might be important. Well unfortunately, in this example, the font used is not "Times roman" but an embedded one: As you can see a small font with 4 characters is created: <> endobj 17 0 obj <> endobj 9 0 obj <> endobj As you can see the names are different: Uhungarumlaut vs Udblacute This is rather strange as the character is displayed correctly and the string is output at once so it begins to look like an acrobat problem for me. BT 0.000 -14.001 Td /CLF113 14.00 Tf 100.000 Tz [ (??????????????????) -28764 ] TJ ET Thinking about this, I tried to look at document.pdf with Ghostscript and it displays just fine! (I've attached the latest document.pdf) Marc Ps: I'm replying to the Batthyani's topic in a separate email. -------------- next part -------------- A non-text attachment was scrubbed... Name: document.pdf Type: application/pdf Size: 1615 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Mon Sep 26 10:32:49 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 26 Sep 2005 12:32:49 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 References: <009801c5c27d$bddaf0b0$0a02a8c0@marcxp> Message-ID: <012801c5c285$a5599e80$0a02a8c0@marcxp> "Marc Battyani" wrote: >Thinking about this, I tried to look at document.pdf with Ghostscript and it >displays just fine! >(I've attached the latest document.pdf) I tried with xpdf and it's OK too. So it looks like it's an Acrobat bug. Maybe you can try with another font like in the examples you sent to me ? Marc From marc.battyani at fractalconcept.com Mon Sep 26 17:17:46 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 26 Sep 2005 19:17:46 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 Message-ID: <02f901c5c2be$3744aeb0$0a02a8c0@marcxp> [The message was refused by the mailing list so I resend it] "M?sz?ros Levente" wrote: >Unfortunately my windows version ghostview doesn't show it correctly. I've tried the last pdf I attached in a previous email on windows with gsview 4.2 (ghostscript 8.14) on windows and it looks OK. Here is what I get. (see the jpgs) Have you found a way to make a pdf with the built-in font ? The other alternative is to do like in the pdf you sent me, that is not use the built-in pdf font but provide one. (Like Dmitri has done for the Cyrillic version). You can use the utilities indicated on his page to convert the windows Times-Roman font to a type 1 for instance. Marc -------------- next part -------------- A non-text attachment was scrubbed... Name: screen-shots.zip Type: application/x-zip-compressed Size: 92202 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Mon Sep 26 20:18:06 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 26 Sep 2005 22:18:06 +0200 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 Message-ID: <044601c5c2d7$689157c0$0a02a8c0@marcxp> "Levente M?sz?ros" wrote: > I found out that Ohungarumlaut and Odblacute (and similarily for the others) > are interchangeable for acrobat reader, but not for gsview. Perhaps they > just changed the name. > > Also tried two shareware pdf viewers, but with even worse results. In this > case I think it's clearly the viewers' fault. > > I tried with different fonts (Helvetica, Arial), but got the same results > with acrobat reader. > > Unfortunately xpdf doesn't run on windows so I've just downloaded the newest > gsview stuff and hungarumlaut is OK as you said when I view the pdf with it! > > But what is more interesting is that I've got good results with acrobat > reader when I use the fonts that come with the gs stuff. I don't know what > is the difference, but included a few examples for you! Cool. > I think you might be right that acrobat reader's default fonts may have some > problems. Yes. It seems unbelievable, but I don't see any other reason why the pdf works with every non default font. At least you have a working solution now ;-) Marc From kw at w-m-p.com Tue Sep 27 06:59:02 2005 From: kw at w-m-p.com (Klaus Weidner) Date: Tue, 27 Sep 2005 01:59:02 -0500 Subject: [cl-pdf-devel] Unicode/ISO-8859-2 In-Reply-To: References: Message-ID: <20050927065902.GB17113@w-m-p.com> On Sat, Sep 24, 2005 at 11:30:26PM +0200, Levente M?sz?ros wrote: > I also had problems running kw-extensions.lisp examples. They produce > empty documents, but I would really need something like that. It looks > much closer to what docbook offers and still I get all the flexibility > of the framework and lisp. It does work for me (using sbcl and clisp on Linux) and produces an output file "/tmp/output.pdf", do you get any error messages when you try to run the examples? (A warning about an undefined reference is intentional.) BTW, you may also want to look at contrib/xhtml-renderer/xml-xform.lisp since that seems to overlap with what you're doing. It's a bit of a hack but handles the basics... -Klaus