[racket] Possibility of speeding up Scribble to PDF when there's lots of images?

From: Daniel Prager (daniel.a.prager at gmail.com)
Date: Mon Jan 6 15:43:40 EST 2014

On Tue, Jan 7, 2014 at 12:54 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

> How are the images produced in your Scribble program/document?
>

Currently I'm using 2htdp/image to generate the images, and including them
in Scribble using
figure, figure* and figure-here.

If you're referencing ".png" files via `image`, then if you could just
> reference ".pdf" files instead. In particular, you could write `image*`
> that converts a ".png" to ".pdf" and calls `image`.
>

Actually 'image' happily includes .pdfs generated by convert.


> If you're generating bitmaps some other way, the right change may be to
> generate a value that is convertable to 'pdf-bytres instead of just
> 'png-bytes, since the Latex/PDF renderer tries 'pdf-bytes before
> 'png-bytes.
>
> If you'd like to experiment with changing Scribble, see
>
>   scribble-pkgs/scribble-lib/scribble/latex-render.rkt
>
> in the Racket repository, around line 342. You could add a convert of
> PNG to PDF via using `pdf-dc%`.


Perhaps using a pdf-dc% to directly generate pdf-based images would make
even more sense? Such an approach would potentially improve quality
-- e.g. nicely rendered text -- in addition to speed.

I'm finding the abstractions in 2htdp/image -- like beside, above, and
overlay
-- very useful and don't really want to give them up! Would you advise
working
directly with the lower-level routines, checking out pict, or is there a
way to stick
with 2htdp/image?


Thanks again

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140107/01b08cb7/attachment.html>

Posted on the users mailing list.