Duplex Printing

I need to print a document duplex if the number of pages is greater than one and is an odd number. I am trying to insert a blank page when this condition is true. However, when I insert the blabk page, it also includes the header and footer. How can I insert a blank page or remove the header and footer from the inserted page? Or is there a better way to do it?
Attached is my code. Lines 260-269 is where I am trying to add the blank page.
Thanks,
Jim Serpe

Hello,
Thank you for your inquiry.
You need to set the property PageSetup.OddAndEvenPagesHeaderFooter for your document. Then making Header for Even page blank you’ll get what you want. If you have any difficulties, please do not hesitate to ask. Also look at this post please, maybe it will be useful: https://forum.aspose.com/t/115666

I attached a sample of a PDF to show the issue. I would page 4 to be blank. Pages 1 - 3 must have the header and footer. Is there a way to make page 4 completely blank with no header or footter?
Thanks

Thank you for additional information.
We have three types of Headers. Look here in our documentation.
It is possible to manage only the first, even and odd header (or footer). There is no way to remove the 4th page header.

Hi
Thanks for your request. You can use code like the following to insert an empty page at the end of the document:

Document doc = new Document(@"Test001\in.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
// move document builder to the end of the document.
builder.MoveToDocumentEnd();
// Insert a section break.
builder.InsertBreak(BreakType.SectionBreakEvenPage);
// reset headers and footers in the current section.
builder.CurrentSection.ClearHeadersFooters();
builder.CurrentSection.HeadersFooters.LinkToPrevious(false);
// Save output.
doc.Save(@"Test001\out.pdf");

Hope this helps.
Best regards,