Setting Image Size when inserting an Image into a Word document

Last post 05-16-2011, 7:49 PM by aske012. 3 replies.
Sort Posts: Previous Next
  •  05-16-2011, 10:13 AM 303657

    Setting Image Size when inserting an Image into a Word document .NET

    Attachment: Present (inaccessible)

    We are using merge fields within a Word document to create word documents dynamically through a template. We are having trouble ensuring a chart (which is in PNG format) is properly sized when the template is populated.

    What options are available for setting the dimensions of an Image when using Aspose Words with merge fields?

    I've attached the template with the image merge field definition.

     

    Filed under: Image;Merge Fields
     
  •  05-16-2011, 2:00 PM 303716 in reply to 303657

    Re: Setting Image Size when inserting an Image into a Word document

    Hello

     

    Thanks for your request. I think, in your case you can try using FieldMergingCallback. Please see the following forum thread to learn how to achieve what you need during MailMerge:

    http://www.aspose.com/community/forums/301784/image-and-merge-field/showthread.aspx#301784

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  05-16-2011, 2:33 PM 303730 in reply to 303657

    Re: Setting Image Size when inserting an Image into a Word document

    I would like to clarify this posting. We would like to know if there is a way to retain the width and height settings that are already specified for the image in the template. We want to avoid additional coding and want the Aspose library to honor the settings specified in the template.

     

     
  •  05-16-2011, 7:49 PM 303790 in reply to 303730

    Re: Setting Image Size when inserting an Image into a Word document

    Hi Brian,

    Thanks for this additional information.

    No, there is no way for the inserted image to inherit the size of the Shape within the current field. However you can easily code this using the handler suggested by Andrey above.

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
View as RSS news feed in XML