Monday, February 25, 2008

We Need a PDF replacement for PicComment

I direct your attention to the very explicitly obsoleted documentation for the QuickDraw routine PicComment. With a call to PicComment, an application would insert whatever arbitrary data it liked into a PICT. It could then put the PICT on the system clipboard. The user could paste it into their favorite word processor. Days, weeks, femtoseconds later, the user could copy the same image back into the clipboard, and paste it back into the original application.

Without a PicComment, there was little the originating application could do, just treat the image as an uneditable graphic, floating lifelessly inside a document. With a PicComment, the application could retrieve enough information to recreate the original selection from which it came; perfectly without loss of quality. Users built up ad hoc workflows around the knowledge they didn't have to save original image documents, but could copy and paste images back from their word processor if they wished to revise.

With the gradual withering away of PICT support in OS X applications, it's well past time to look at getting round-trip clipboard support back. I hope Apple is thinking about this. The obvious solution is to:
  • Extend the keys available to CGPDFContextCreate and other similar PDF creating APIs to include private vendor data. Presumably, you could provide a dictionary under a kCGPDFContextVendorPrivateData key, with a kCGPDFContextVendorID (like "com.genhelp.mygreatapp") and an XML fragment—or other convenient format—needed to recreate the original.
  • Encourage application developers to preserve original PDF data whether received via file insertion, pasting or dragging. This would include Apple's own applications such as Preview and Text Edit. Often, applications will thoughtlessly re-render an image into PDF even when the source was PDF to begin with, heedlessly throwing away the original's auxiliary data.
  • Add similar functionality to the TIFF flavor favored by image editing software.

Presumably, the host application wouldn't even need to save the whole original, just the contents of the vendor dictionary.

And users can leave the world where a copy/paste is a one way trip.