Creating a PDF on the fly


#1

A friend and I are just in the process of trying to create PDFs on the
fly. This isn’t in itself too hard, but we have some repeating images
that are being put in over and over again. It’s increasing file size
too much unfortunately.

Does anyone know the best way to ensure file size is kept to a minimum
for this scenario? We know about linking to a URI, but the problem with
that is that if the PDF gets sent elsewhere, we have to send the linked
images with it.

Any help would be appreciated.

Thanks

Paul

PJ Net Solutions Ltd
0871 223 5370
http://www.pjnetsolutions.com
Registered Number : 4131671 - Registered in England and Wales
Registered address : 35 Ballards Lane, London, N3 1XW
Office address : 17 Mortain Drive, Berkhamsted, HP4 1JZ


#2

On 2/27/07, Paul J. removed_email_address@domain.invalid wrote:

A friend and I are just in the process of trying to create PDFs on the
fly. This isn’t in itself too hard, but we have some repeating images
that are being put in over and over again. It’s increasing file size
too much unfortunately.

If you’re using PDF::Writer, then it’s trivial to reuse images that
are repeating. You just have to do it right (and the demo
chunkbacon.rb shows how).

If you’re not using PDF::Writer, then you need to be more specific
about your problem.

-austin

Austin Z. * removed_email_address@domain.invalid * http://www.halostatue.ca/
* removed_email_address@domain.invalid * http://www.halostatue.ca/feed/
* removed_email_address@domain.invalid


#3

On Tue, 2007-02-27 at 09:00 -0500, Austin Z. wrote:

On 2/27/07, Paul J. removed_email_address@domain.invalid wrote:

A friend and I are just in the process of trying to create PDFs on the
fly. This isn’t in itself too hard, but we have some repeating images
that are being put in over and over again. It’s increasing file size
too much unfortunately.

If you’re using PDF::Writer, then it’s trivial to reuse images that
are repeating. You just have to do it right (and the demo
chunkbacon.rb shows how).

That’s helpful thanks. I hadn’t found the “demo” section because I was
looking for “examples” :slight_smile: I have actually looked at the gem code to
figure out how to load the image only once. Figured it out now, so
thanks. Really helpful.

Paul

PJ Net Solutions Ltd
0871 223 5370
http://www.pjnetsolutions.com
Registered Number : 4131671 - Registered in England and Wales
Registered address : 35 Ballards Lane, London, N3 1XW
Office address : 17 Mortain Drive, Berkhamsted, HP4 1JZ