josh.gomez

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts

  • josh.gomez
    Participant

    No it was not a bug in DocumentBuilder, I used the OpenXML library to remove header in the document which I stored footer and after I did the merge with DocumentBuilder but with the code above I don’t need to do that but I forgot to remove the method which made the document section sort “invalid” but it still “worked”.

    When I removed the method the section became a duplicate instead. So I just had to remove the duplicated section bind searching for duplicates.

    The only thing I need to delete now is the paragraph in header and footer document.
    and then merge with the code above and remove the duplicated section and it works.


    josh.gomez
    Participant

    I can’t edit anymore so I post again. I just want to say I solved the problem. First it was another “bug” which made the section references different.

    It was actually a duplicated which contained same section reference actually 6 reference in both section which was identical so I just had to search for the sections with duplicated id and remove the first one and it’s parent <w:pPr>.


    josh.gomez
    Participant

    Hello Eric White,

    Thanks for fast reply.

    The purpose is to have multiple footer and header documents, they will have same section settings I only want to combine different content stored in those document for easier modification where I can focus on making templates that only include a body.

    I could use your library too merge header and body and then using something else to combine the footer from another document.

    I have seen some example but it does not include images stored in the footer.
    Is it AltChunk I should use? Do you know any good example? Thanks.

    I also posted the question on StackOverflow:
    http://stackoverflow.com/questions/35873789/c-sharp-how-to-merge-3-documents-header-footer-and-body-separated-in-each-docu

    • This reply was modified 8 years, 1 month ago by  josh.gomez.

    josh.gomez
    Participant

    I could not edit the thread any more so I do another post with additional information.

    Here is the end of the document.xml

    
    <...>
    		<w:p w:rsidR="005C6B96" w:rsidRPr="00B14B81" w:rsidRDefault="005C6B96" w:rsidP="004F23F1"/>
    		<w:p w:rsidR="00077D08" w:rsidRDefault="00D14262">
    			<w:pPr>
    				<w:sectPr w:rsidR="00077D08" w:rsidSect="0018015B">
    					<w:footerReference w:type="even" r:id="rId7"/>
    					<w:footerReference w:type="default" r:id="rId8"/>
    					<w:headerReference w:type="first" r:id="rId9"/>
    					<w:footerReference w:type="first" r:id="rId10"/>
    					<w:type w:val="continuous"/>
    					<w:pgSz w:w="11906" w:h="16838" w:code="9"/>
    					<w:pgMar w:top="1418" w:right="1418" w:bottom="2552" w:left="1418" w:header="318" w:footer="851" w:gutter="0"/>
    					<w:cols w:space="708"/>
    					<w:titlePg/>
    					<w:docGrid w:linePitch="360"/>
    				</w:sectPr>
    			</w:pPr>
    			<w:r>
    				<w:t>Josh Gomez</w:t>
    			</w:r>
    			<w:bookmarkStart w:id="0" w:name="_GoBack"/>
    			<w:bookmarkEnd w:id="0"/>
    		</w:p>
    		<w:p w:rsidR="00D14262" w:rsidRDefault="00D14262"/>
    		<w:sectPr w:rsidR="00D14262" w:rsidSect="0018015B">
    			<w:footerReference w:type="even" r:id="rId11"/>
    			<w:footerReference w:type="default" r:id="rId12"/>
    			<w:footerReference w:type="first" r:id="rId13"/>
    			<w:type w:val="continuous"/>
    			<w:pgSz w:w="11906" w:h="16838" w:code="9"/>
    			<w:pgMar w:top="1418" w:right="1418" w:bottom="2552" w:left="1418" w:header="318" w:footer="851" w:gutter="0"/>
    			<w:cols w:space="708"/>
    			<w:titlePg/>
    			<w:docGrid w:linePitch="360"/>
    		</w:sectPr>
    	</w:body>
    </w:document>
    
Viewing 4 posts - 1 through 4 (of 4 total)