xpdfSpliceCopyOptionalContentSetup

Copy the optional content (layers) setup info from an input PDF file to an output PDF file.
void xpdfSpliceCopyOptionalContentSetup(XpdfSpliceInputHandle in, XpdfSpliceOutputHandle out)
Copies all of the optional content (aka layers) setup information from an input PDF file to an output PDF file. This setup information is needed to define the layers in the output PDF file.

The optional content setup can only be copied from a single input PDF file. This function won't work in cases where you are merging pages from two or more PDF files.

If there is no optional content in the input PDF file, this function does nothing, i.e., it's safe to call on any input file.

C:
XpdfSpliceInputHandle in; XpdfSpliceOutputHandle out; ... xpdfSpliceCopyOptionalContentSetup(in, out); ...