I'm still stuck. I managed to add a image to the page content (without any OCG reference) but not sure if I'm on the right track.
>> The page stream refers to the image dictionary via a Do operator after scaling with a cm operator, and wrapped in a q/Q group.
Does this mean creating a Form XObject using PDEFormCreateFromCosObj?
For a PDF in which the layer was added using Adobe, PDF CanOpener shows a Form XObject having a reference to the OC. So I'm guessing that the Form XObject is what I'm missing.
Thanks,
Radu