Merging multiple documents and footers and headers

Developer
Oct 7, 2010 at 11:04 PM

Hello,

I used newest version of Source Code 55074 to try if merging was fixed and it seems to be working fine now! The only problem is it seems like it skips to merge headers and footers. All my documents I am merging have different pictures in header / footers (some do have them the same). It seems like the whole content of doc is copied but headers and footers are not. Is this on the list of things to fix (add, and if yes when?) or I am doing something wrong?

With regards,

MadBoy

Developer
Nov 22, 2010 at 4:12 PM

Any option for this to happen ?

Coordinator
Jan 5, 2011 at 4:48 PM
Hi MadBoy,

I just wanted to say thank you. I saw your two posts on http://stackoverflow.com. According to codeplex, you have referred quite a few people to the DocX home page.

By the way, I have started working on your requested feature. I have a basic implementation of Page Numbers working. I'm not ready to release this yet as Word offers many customizations such as Page n, Roman Numbers, Page n of m. I am trying to find the best way of offering this features in DocX.

Regards,
Cathal

P.S. Have you tried DocX v1.0.0.11 yet? Its been downloaded 100 times but nobody has provided feedback. I don't know if its a success or a disaster.
Developer
Jan 5, 2011 at 4:56 PM

Hello,

I've downloaded it myself but wasn't adding it to my project yet. I guess I'll add it to my current project and see how it behaves. Will let you know soon.

Stackoverflow is great site with great help from people so I try to repay the help I get and I do believe DocX is best tool for the job. So whenever I answer posts about Word I always suggest DocX :-)

With regards,

PS. I think I've posted more times on stackoverflow then just two regarding your DocX project :-) But it's very nice that it gets pointed to your project.

MadBoy

Coordinator
Jan 5, 2011 at 9:01 PM
MadBoy,

I found a few hours tonight and finished coding your new feature. Please check-out change set 59719 http://docx.codeplex.com/SourceControl/changeset/changes/59719

Let me know if this is what you expected. If you have any suggestions for how it should be changed please email me.

Happy coding,
Cathal
Developer
Jan 5, 2011 at 10:05 PM
Edited Jan 5, 2011 at 10:07 PM

Hello Cathal,

 

What would be the behavior on merging multiple documents having pages with numbers 1 to 4. I would expect merged document to keep each merged document number ..(at least that’s what project want from me). So that multiple page 1 - 4 would exist. On the other hand in some cases it would be good to have it merged and start 1 to <all pages>.

 

With regards,

 

MadBoy

 

From: coffeycathal [email removed]
Sent: Wednesday, January 05, 2011 10:02 PM
To:
Subject: Re: Merging multiple documents and footers and headers [DocX:230066]

 

From: coffeycathal

MadBoy,

 

I found a few hours tonight and finished coding your new feature. Please check-out change set 59719 http://docx.codeplex.com/SourceControl/changeset/changes/59719

 

Let me know if this is what you expected. If you have any suggestions for how it should be changed please email me.

 

Happy coding,

Cathal

Developer
Jan 5, 2011 at 10:08 PM

Also is there a way to work with DocX without making project 4.0 ? I still have 3.5 project and although i've been thinking on converting it i wanted to give it couple more weeks before deploying it

With regards,

MadBoy

Coordinator
Jan 6, 2011 at 12:21 AM
MadBoy,

I have made many changes in DocX v1.0.0.11 which rely on .NET 4.0 optional parameters.It is therefore not possible to compile it as a 3.5 assembly. You could keep using DocX v1.0.0.10 and earlier which are all .NET 3.5.

On a similar note, VS2008 can't handle .NET 4.0 assemblies. I think Microsoft are trying to move people to VS2010. Eventually, when nobody wants it anymore, Microsoft will release a patch for VS2008 that supports .NET 4.0.

Regards,
Cathal
Coordinator
Jan 6, 2011 at 12:35 AM
MadBoy,

This is an interesting question. Pages don't really exist. By this I mean they don't exist internally in the document. The concept of a page only exists when Word.exe draws the content of a document to screen.

Word.exe adds content to a page until the sum of that contents height reaches the page height. It then creates a new page. The height of each piece of content is determined by font size for text and height properties for objects such as Pictures, Charts etc.

The matter is complicated more when you take into account the fact that every element (Paragraphs, Tables, Charts, Pictures) can have margins, padding's and off-sets.

To make matters even worse, Page Breaks, Headers, Footers and Floating-Text-Boxes exist.

This is the reason I have not yet created a document viewer or added printing support to DocX. These are long term goals and will require a huge development effort.

Cathal
Developer
Jan 6, 2011 at 6:21 PM

Hello Cathal,

I do have Visual Studio 2010 and the only thing stopping me to upgrade my program for 7 people with 4.0 is that I will have to do some more extensive tests after the change of current code base (and I don't have any tests written). I am one man developer of over 100k lines of code program and I am just a bit afraid something will go wrong and i will have to start stitching it up fast, and I'm really overloaded lately.

But ye, I'll upgrade the project and see over the weekend how it goes and Monday deploy it to users.

With regards,

Przemek

Developer
Jan 6, 2011 at 6:27 PM

I  like the way this project is evolving and surely it would be even nicer if there would be more people, dedicated like you for this project to make it long term goals (like printing/save as pdf and stuff it's missing) doable.

Keep up the good work. I think this project can make your career/work skyrocket soon. And maybe in longterm scenario even bring you something more then just handful of users requesting features :-)

With regards,


MadBoy

Coordinator
Jan 6, 2011 at 7:46 PM
MadBoy,

I started a 4 year PhD in September, so I doubt DocX will help my career/work. Not in the short term anyway.

I really enjoy developing it and its great getting positive feedback from users. The real reason I keep developing, is that every now and then, someone sends an email saying "Thanks, DocX really helped me out". Ive received emails from all kinds of people, from all walks of life, from all over the globe. I keep meaning to generate a map using Open Layers and draw a marker for every person that contacts me. This would be a cool motivator for me to continue.

As always, happy coding,
Cathal
Developer
Jan 6, 2011 at 7:49 PM

You could always use Google Analytics to draw you a map of users visiting your webpage :-) Maybe there will be a day that you get to see full map with green color all over the world :-)

Jan 13, 2011 at 7:55 AM
coffeycathal wrote:
MadBoy,

I started a 4 year PhD in September, so I doubt DocX will help my career/work. Not in the short term anyway.

I really enjoy developing it and its great getting positive feedback from users. The real reason I keep developing, is that every now and then, someone sends an email saying "Thanks, DocX really helped me out". Ive received emails from all kinds of people, from all walks of life, from all over the globe. I keep meaning to generate a map using Open Layers and draw a marker for every person that contacts me. This would be a cool motivator for me to continue.

As always, happy coding,
Cathal

 Hi Cathal,

I think this library has more potential then just honour and satisfaction, but could pay for your PhD in full. Of course the user community motivates. But, as this world is all economics, investing now could mean a great benefit in the future.  
If your main drive is on the community, then let it be. If you see the potential as a commercial product, go for it and build a business. If you consider what you have accomplished in comparison to commercial competitors on your own so far, the future is indeed yours.

Best of luck (or in star trek terms 'go and prosper')

Marcel

Coordinator
Jan 13, 2011 at 10:47 AM
Marcel,

thank you for your kind words.
At the moment DocX nets me about 100 euro a year in donations.
Its not enough to pay for my PhD but I do really enjoy developing it.

Kind regards,
Cathal
Apr 8, 2011 at 1:59 PM

I also have problems when merging multiple documents (InsertDocument method): the footers/header disappears in the final merged document. Has it beeb resolved? Thanks!

Developer
Apr 8, 2011 at 2:05 PM

I don't think so. I keep on using merging thru Word Interop just because of this. It's much longer process and more prone to errors but until Cathal can find time to fix this we're out of luck. If you're interested in Interop then let me know and I can point you in right direction. It wasn't as obvious for merging of footers / headers to work.

Apr 8, 2011 at 2:32 PM

MadBoy,

thanks for the answer. Please, could you share or send that pieace of code?

Developer
Apr 8, 2011 at 2:37 PM
Edited Apr 8, 2011 at 2:37 PM

I had to get some help with this but the accepted answer is what you need: http://stackoverflow.com/questions/3900111/merging-docx-files-together-including-headers-footers-and-pictures