Michaela

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: DocumentBuilder: Image gets lost #4104

    Michaela
    Participant

    Hi Eric,

    thanks for this offer. Unfortunately, I’m not allowed to pay for any support. So I have to do this on my own.

    Have a nice weekend!
    Michaela

    in reply to: DocumentBuilder: Image gets lost #4101

    Michaela
    Participant

    Hi Eric,

    thanks for your fast response.
    I’m not able to write you why the exernal links are important. I’m just a developer of a software where customers can create documents and merge them (and do much more). I used the DocumentBuilder as a base and adapted all where our needs were different. So the software has to be able to merge all the customer documents independant of what they contain. And now I have to find a solution for the external links because the customer documents contain them. Throwing an exception wouldn’t be a solution for me.

    I’ll read about the external links and hope to find a way to handle them. If I’ll find a good solution I’ll let you know.

    Thanks for your support,
    Michaela

    in reply to: DocumentBuilder: Image gets lost #4096

    Michaela
    Participant

    Hi Eric,

    I thought that the error occurs AFTER the merging. That is not correct. I found out that the error occurs WHILE merging but I see it after it when I update all fields in the merged documents.

    So there is a bug I think. I have one document with a picture in it and a second document with a link to another document. When I merge those files the first picture becomes a link too and the picture gets lost. This isn’t correct.

    I created test documents for you and uploaded them (The linked document is not included but it’s not neccessary to show the behaviour):

    Docs

    It would be great if you could have a look at it.

    Thanks a lot in advance.

    Kind regards,
    Michaela

    • This reply was modified 7 years, 3 months ago by  Michaela.
    in reply to: DocumentBuilder: Image gets lost #4094

    Michaela
    Participant

    Hi Eric,

    thanks for your fast response. While creating test documents for you I recognized that the bug occurs AFTER merging the documents with the DocumentBuilder. So there is no bug in your code.

    Sorry for the inconveniences.

    Best regards,
    Michaela


    Michaela
    Participant

    I found the answer to my question:
    There are differences in the standard style which is the base of my custom style.


    Michaela
    Participant

    Hi Thierry,

    thanks a lot for describing me your solution and to be so fast.

    It’s my first day with Open Xml SDK, DocumentBuilder and C#, but I think I found a solution right now that works for me. Maybe you can have a look at it? I just made a little change in the code of the DocumentBuilder. In DocumentBuilder.cs in function “AppendDocument” in the line that starts with “if (keepSection == false)” (It’s in line 1273 in my code) I replaced everything in this block (I mean between “{” and “}”) with the following lines:

    newContent.Descendants(W.headerReference).Remove();
    newContent.Descendants(W.footerReference).Remove();

    My aim is that the header and footer should be the same as the previous, but all other information should stay (like format/size/orientation of page).

    I don’t know if this is a good solution or if there will be other problems because of my change, but I will try to use this.

    Kind regards,
    Michaela


    Michaela
    Participant

    Hi Eric,

    I just started using Open Xml SDK and the DocumentBuilder. The answer of this question above would be very helpful for me. Do you have an answer in the meantime or are you still buried in your other project?

    Thanks a lot in advance,
    Michaela

Viewing 7 posts - 1 through 7 (of 7 total)