Generate documents from one template

Last post 01-19-2011, 6:00 AM by aspose.notifier. 9 replies.
Sort Posts: Previous Next
  •  03-23-2010, 9:47 AM 228612

    Generate documents from one template

    generate documents a template

    what i need to do is simple to explain but seams to be har to do 

    I have one word template dotx and a colection os documents docx.
    I wish to merge all this documents in a new document that use my word template.

    the code to exemplify 

                Document doc = new Document(wordtemplate);
                foreach (var docpath in docColection) { doc.AppendDocument(new Document(docpath),ImportFormatMode.UseDestinationStyles);
    }

    when i try to do that my template lose the header and footer and the documents appended sont follow the rules of the template, like have two coluns like the template has.
    Filed under: append documents
     
  •  03-23-2010, 11:19 AM 228647 in reply to 228612

    Re: Generate documents from one template

    Hi

     

    Thanks for your request. Could you please attach your template and documents, which you should insert into the template? I will check the issue and provide you more information. Also please attach a document, which will demonstrate what the expected result is. It will help me to understand your requirements better.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  03-23-2010, 12:30 PM 228668 in reply to 228647

    Re: Generate documents from one template

    Attachment: Present (inaccessible)
     the documents that you requested are atached

    this is a big impedment in my company and would be a huge argument if that worked to buy aspose
     
  •  03-24-2010, 2:36 AM 228768 in reply to 228668

    Re: Generate documents from one template

    Hi

     

    Thank you for additional information. I think the following code should satisfy your needs.

     

    Document doc = new Document(@"Test001\Template.dotx");

    Document[] docColection = new Document[] { new Document(@"Test001\Pleno.docx"), new Document(@"Test001\Presidente.docx") };

     

    foreach (Document document in docColection)

        InsertDocument(doc.LastSection.Body.LastChild, document);

     

    doc.Save(@"Test001\out.docx");

     

    You can find InsertDocument method here:

    http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/howto-insert-a-document-into-another-document.html

     

    Please let me know in case of any issues.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  03-24-2010, 5:32 AM 228817 in reply to 228768

    Re: Generate documents from one template

    Attachment: Present (inaccessible)
    no it don't make the result i want it lost all the textbox of word and when i try to save it to pdf it makes a real mess i will send you the files
     
  •  03-24-2010, 9:15 AM 228864 in reply to 228817

    Re: Generate documents from one template

    Hi

     

    Thank you for additional information. As I can see your word document looks fine. Please clarify what do you mean when say that textboxes are lost.

    Regarding converting to PDF:

    1. I managed to reproduce the problem with table width. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

    2. Text overlaps an image at the top of the document. the problem occurs because at the moment Aspose.Words does not fully support text wrapping of shapes. You will be notified as soon as this feature is fully supported. As a workaround, you can try refactoring your document. for example you can make an image at the top to be inline and move it into the document header.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  03-24-2010, 9:25 AM 228868 in reply to 228864

    Re: Generate documents from one template

    if you see at the header of the document it lost all the words that where there and it lost the words at the footer too,

    in the pdf there still problems with tables and not only with the image
     
  •  03-24-2010, 9:40 AM 228876 in reply to 228868

    Re: Generate documents from one template

    Hi

     

    Thank you for additional information. I managed to reproduce the problem with textboxes in header/footer. We will let you know once this issue is resolved.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  05-14-2010, 8:42 AM 238076 in reply to 228612

    Re: Generate documents from one template

    The issues you have found earlier (filed as 15359) have been fixed in this update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
     
  •  01-19-2011, 6:00 AM 279393 in reply to 228612

    Re: Generate documents from one template

    We are happy to tell you that a very cool and important feature (filed as 7180) is included in the new version of Aspose.Words. Text wrapping around images and shapes when rendering Microsoft Word documents to PDF, XPS and printing is now supported. You can download the latest version from here.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
    (34)
     
View as RSS news feed in XML