Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

How to support double sided printing

Last post 09-06-2010, 12:43 AM by Eric Novaware. 2 replies.
Sort Posts: Previous Next
  •  09-03-2010, 8:55 AM 256985

    How to support double sided printing .NET

    Attachment: Present (inaccessible)
    Hi , 

    I would like to print the pdf i render doublesided , therefore i need to append completly blank/white pages to my existing document. I'm using to function below to check if the document has an even or odd pagecount en when it's odd i append a blank template .
    However the template inherrits the header and footer from the main document, how can i prevent this from happening , because the page needs to be completly white with no header and footer from a previous set of pages.

    I've added the following files :
    - current result (page 24 , 25)
    - maindoc template with the header and footer
    - blankpage template

    kind regards,
    Eric

     
  •  09-03-2010, 10:14 AM 256999 in reply to 256985

    Re: How to support double sided printing

    Hello

     

    Thanks for your inquiry. You should just set KeepSourceFormatting and unlink headers/footer before appending documents. Please see the following code:

     

    Document dst = new Document(@"MainDoc.dot");

    Document src = new Document(@"blankPage.doc");

     

    // Unlink HeadersFooters

    src.FirstSection.HeadersFooters.LinkToPrevious(false);

     

    // Set SectionStart to NewPage

    src.Sections[0].PageSetup.SectionStart = SectionStart.NewPage;

     

    dst.AppendDocument(src, ImportFormatMode.KeepSourceFormatting);

     

    dst.Save(@"out.pdf");

     

    Best regards, 


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  09-06-2010, 12:43 AM 257146 in reply to 256985

    Re: How to support double sided printing

    Hi ,

    Many thanks , this solution works perfect .

    Kind regards ,

    Eric 
     
View as RSS news feed in XML