Problem converting pdfs to jpegs with Cocoa & Quartz...
Problem converting pdfs to jpegs with Cocoa & Quartz...
- Subject: Problem converting pdfs to jpegs with Cocoa & Quartz...
- From: Michael Heinz <email@hidden>
- Date: Mon, 9 May 2005 06:40:50 -0400
Hello, all.
I'm working on a little program to convert PDF pages to jpegs for
display on a handheld device; I figured out how to do everything, the
rotations and so forth, but I'm stuck on one odd issue: I can resize
the resulting image to make it smaller than the original PDF and that
works fine, but if I try to resize it to larger than the original PDF
it doesn't work - I get the PDF rendered in the middle of a larger box.
This is a bit of a problem, since a PDF's "size" is measured in terms
of 72 dpi, so a document 8 inches wide is only 576 pixels, which means
small details are hopelessly blurry in the final image.
Can anyone give me a suggestion on how to handle this correctly?
The approach I'm taking is:
1) create an image of the desired size.
2) lock focus.
3) get context.
4) save state.
5) create drawing transform and attach.
6) render page.
7) restore state.
8) get bitmap representation.
9) unlock focus.
10) convert bitmap to jpeg.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden