• 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
making small pdfs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

making small pdfs


  • Subject: making small pdfs
  • From: Jim Mooney <email@hidden>
  • Date: Sat, 21 Oct 2006 11:55:05 -0400

My experience so far in generating pdfs in Cocoa or Quartz is that the pdfs generated either through NSPrinterOperation or Quartz calls are very large.

There does not seem to be any documentation on how to take a compressed jpg, draw it into a pdf and then get the benefit of the jpg compression to make the resulting pdf a smaller file size.

If you take create an NSImage with a Jpg and then draw it into a pdf, the result file depending on resolution is bigger when saving the pdf by a factor of at least 10. ie a 30k jpg becomes 300k pdf. I believe I understand why, the compression from the jpg is lost when the NSImage is drawn to a pdf context. ie bits and colors are saved without compression as the same bits and colors.

Does anyone have any pointers in either in Quartz or Cocoa to use an approved compression so that say I can embed the jpg inside the pdf and when Acrobat or Preview knows and renders the image. The intent is to scan a document or documents and then save the resulting scan as a pdf which contains an embedded jpg of the scanned document. Each page would have an embedded jpg of the pdf page scanned.

I see references to CGPDFContextStream but I don't see where you can control the compression factors of the jpg.

Anyone have a couple lines of code, or api call that can point me in the right directions?

Jim

_______________________________________________
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: making small pdfs
      • From: Scott Ribe <email@hidden>
  • Prev by Date: NSCell subclass with custom binding
  • Next by Date: Re: Tokenfield blues (literally)
  • Previous by thread: Re: NSCell subclass with custom binding
  • Next by thread: Re: making small pdfs
  • Index(es):
    • Date
    • Thread