Re: [racket] Snips displaying pdfs

2012-05-12 Thread Michael W
(What's racket's policy on posting our own work to the mailing list? Sorry if this seems like spam.) (planet gcr/render-pdf) now implements more of the libpoppler glib API. You can now render PDF files to picts or bitmap%s, gather the locations of all letters on the page, or can search for strings

Re: [racket] Snips displaying pdfs

2012-05-10 Thread Jens Axel
Den 08/05/2012 kl. 15.31 skrev Michael W : > Hm. What I meant was, is there a way to do that without > rasterization? I intended to use this for rendering posters, > where a 3MB 2000dpi image is less desirable than a few > line-drawing commands. It would be lovely to be able to rotate > and sc

Re: [racket] Snips displaying pdfs

2012-05-08 Thread Michael W
Hm. What I meant was, is there a way to do that without rasterization? I intended to use this for rendering posters, where a 3MB 2000dpi image is less desirable than a few line-drawing commands. It would be lovely to be able to rotate and scale PDFs with slidehsow/pict without converting them to bi

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Jens Axel Søgaard
2012/5/8 Michael W : > Sure, but I mean, is there a better way to get at a dc<%>'s cairo > context than (require racket/draw/private/local) ? From what I > understand, those areas aren't meant to be used by third-party > libraries, and definitely not by planet packages. Not all dc<%>s > are even ba

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Eli Barzilay
A few minutes ago, Michael W wrote: > Sure, but I mean, is there a better way to get at a dc<%>'s cairo > context than (require racket/draw/private/local) ? From what I > understand, those areas aren't meant to be used by third-party > libraries, and definitely not by planet packages. Not all dc<%>

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Michael W
Sure, but I mean, is there a better way to get at a dc<%>'s cairo context than (require racket/draw/private/local) ? From what I understand, those areas aren't meant to be used by third-party libraries, and definitely not by planet packages. Not all dc<%>s are even backed by cairo contexts... 16 m

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Eli Barzilay
Three hours ago, Michael W wrote: > > I'm not rasterizing to a bitmap% or anything like that. Instead, > I'm asking poppler to draw directly to the dc<%>'s cairo context > (Eli and Matthew are probably cringing), which means that you can > render to arbitrary dc<%> objects at the cost of being muc

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Michael W
(sorry; forgot to cc users@) Done! ...Sort of. Put a 'test.pdf' in (current-directory) and try this out: (require slideshow/pict (planet gcr/pdf-render)) (show-pict (rotate (pdf-page->pict "./test.pdf" 0) (* 0.25 pi))) I'm not rasterizing to a bitmap% or anything lik

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Jens Axel Søgaard
Hi Michael, It would be great if you turned it into a Planet package. I had no immediate need for pdfs, so I put it on hold. The code attached to the old message rendered the pdf into a png on disc, and then loaded the png as a snip. Since then Matthew added get-handle to Racket, so now one can

Re: [racket] Snips displaying pdfs

2012-05-07 Thread Michael W
This is wonderful. Do you mind if I publish a planet package using this code? 2 months ago on Sunday, Mar 18, 08:29AM, Jens Axel Søgaard wrote: > 2012/3/17 Neil Van Dyke : > > Jens Axel Søgaard wrote at 03/17/2012 09:17 AM: > > > >> Is it possible to display pdfs in snips without converting them t

Re: [racket] Snips displaying pdfs

2012-03-27 Thread Matthew Flatt
At Sun, 18 Mar 2012 15:29:01 +0100, Jens Axel Søgaard wrote: > I can now open a pdf-file and render it into a cairo_t context. > The code is attached. To test that the rendering works, > I saved it in a png, and then displayed it in a snip. > > I am struggling with creating a bitmap directly from

Re: [racket] Snips displaying pdfs

2012-03-18 Thread Jens Axel Søgaard
2012/3/17 Neil Van Dyke : > Jens Axel Søgaard wrote at 03/17/2012 09:17 AM: > >> Is it possible to display pdfs in snips without converting them to >> bitmaps? > You might be able to implement this using Poppler. >  http://en.wikipedia.org/wiki/Poppler_%28software%29 Looks like Poppler is the way

Re: [racket] Snips displaying pdfs

2012-03-17 Thread Neil Van Dyke
Jens Axel Søgaard wrote at 03/17/2012 09:17 AM: Is it possible to display pdfs in snips without converting them to bitmaps? You might be able to implement this using Poppler. http://en.wikipedia.org/wiki/Poppler_%28software%29 Neil V. -- http://www.neilvandyke.org/ ___

Re: [racket] Snips displaying pdfs

2012-03-17 Thread Robby Findler
On Sat, Mar 17, 2012 at 8:17 AM, Jens Axel Søgaard wrote: > Is it possible to display pdfs in snips without converting them to bitmaps? > > I can see that pdf-drawing contexts are supported, but can't > find anything to display them. I think pdf-dc% objects are for producing pdfs, not rendering t

[racket] Snips displaying pdfs

2012-03-17 Thread Jens Axel Søgaard
Is it possible to display pdfs in snips without converting them to bitmaps? I can see that pdf-drawing contexts are supported, but can't find anything to display them. -- Jens Axel Søgaard Racket Users list: http://lists.racket-lang.org/users