making small pdfs
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