# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET doc = aw.Document() builder = aw.DocumentBuilder(doc) # The number of pages the document should have numPages = 4 # The document starts with one section, insert the barcode into this existing section self.insert_barcode_into_footer(builder, doc.first_section, aw.HeaderFooterType.FOOTER_PRIMARY) for i in range(1, numPages) : # Clone the first section and add it into the end of the document cloneSection = doc.first_section.clone(False).as_section() cloneSection.page_setup.section_start = aw.SectionStart.NEW_PAGE doc.append_child(cloneSection) # Insert the barcode and other information into the footer of the section self.insert_barcode_into_footer(builder, cloneSection, aw.HeaderFooterType.FOOTER_PRIMARY) # Save the document as a PDF to disk # You can also save this directly to a stream doc.save(docs_base.artifacts_dir + "InsertBarcodeImage.docx")