link_to_previous method

Links or unlinks all headers and footers to the corresponding headers and footers in the previous section.

def link_to_previous(self, is_link_to_previous):
    ...
Parameter Type Description
is_link_to_previous bool True to link the headers and footers to the previous section; False to unlink them.

Example

import groupdocs.watermark as gw
from groupdocs.watermark.options.word_processing import WordProcessingLoadOptions
import groupdocs.watermark.contents.word_processing as wp

load_options = WordProcessingLoadOptions()
with gw.Watermarker("document.docx", load_options) as watermarker:
    content = watermarker.get_content()
    for i in range(1, content.sections.count):
        content.sections[i].headers_footers.link_to_previous(True)
    watermarker.save("output.docx")

See Also