• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem converting pdfs to jpegs with Cocoa & Quartz...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Problem converting pdfs to jpegs with Cocoa & Quartz...
      • From: Sven Hoffmann <email@hidden>
  • Prev by Date: I want NSTextField to grow as text is entered
  • Next by Date: Re: #pragma mark
  • Previous by thread: Re: I want NSTextView to grow horizontally as text is entered
  • Next by thread: Re: Problem converting pdfs to jpegs with Cocoa & Quartz...
  • Index(es):
    • Date
    • Thread