• 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
Scaling CGPDFPageRefs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scaling CGPDFPageRefs


  • Subject: Scaling CGPDFPageRefs
  • From: "Maryanna Rogers" <email@hidden>
  • Date: Thu, 24 Jan 2008 11:15:31 -0500

Hi,

I'm trying to load a pdf file, scale some portion of it (zoom in, for
example), and draw this scaled result to a CGBitmapContext.

I've tried things like the following, with no luck:

CGPDFPageRef page = CGPDFDocumentGetPage(doc, 1);
CGAffineTransform m = CGPDFPageGetDrawingTransform (page,
kCGPDFMediaBox, CGRectMake(0, 0, 50, 50), 0, true);
CGContextConcatCTM (myPDFContext, m);
CGContextClipToRect (myPDFContext, CGRectMake(0, 0, 4, 4));

CGContextDrawPDFPage(myBitmapContext, page);

I'm not comfortable with the transformations I've done here, but it's
all I've been able to find in the Apple documentation.

Again, what I would like to do, is have an existing bitmap context of
a given size (128 x 128, for example), and draw scaled subregions of a
given PDF document page into that bitmap context. Is there a simple
way to do this?

Thanks!

~m
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Scaling CGPDFPageRefs
      • From: John Calhoun <email@hidden>
    • Re: Scaling CGPDFPageRefs
      • From: David Duncan <email@hidden>
  • Prev by Date: Move NSPanel using Core Animation
  • Next by Date: Re: NSTimer preventing sleep?
  • Previous by thread: Re: Move NSPanel using Core Animation
  • Next by thread: Re: Scaling CGPDFPageRefs
  • Index(es):
    • Date
    • Thread