Skip to Content

Why does the PDPageDrawContentsToWindow method render annotations on a PDF page, but PDPageDrawContentsToWindowEx will not?

Estimated Reading Time: 1 Minutes

Adobe PDF Library does not offer a single interface that will allow control of both Optional Content and Annotations at the same time for a PDF document.

PDPageDrawContentsToMemory() allows selection of Annotation faces, but does not have control for Optional Content.

If you want to draw Optional Content for a given page in a PDF document, call PDPageFlattenOC() prior to drawing the page.

Optional Content, or “layers,” are a useful way to present information when opening a PDF file. For example, you could create a brochure with multiple layers offering the same content but in different languages. The first layer would be the blank background page. The resulting PDF file could be set up, with some extra program code, to select the appropriate layer with French or Spanish or English, depending on the language of the reader, and then display that language in the PDF file.

Why does the PDPageDrawContentsToWindow method render annotations on a PDF page, but PDPageDrawContentsToWindowEx will not?
  • COMMENT