Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Apr 21, 2017 10:02 am

Hello,

we are a licensed user of Spire Doc and one of the things we do with it is to insert images into Word documents. We have found how to set the "Maintain aspect ratio" on Presentations but we have not found how to do it from Word documents.

Any hint would be helpful.

Here is how we are adding the images right now:

Code: Select all
        private static void AddImage(Section documentSection, byte[] imageBytes, float percent, int index, string imageId)
        {
            Paragraph paragraph = documentSection.AddParagraph();
            DocPicture docPicture = paragraph.AppendPicture(imageBytes);
            paragraph.AppendBreak(BreakType.PageBreak);

            docPicture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
         
            docPicture.VerticalOrigin = VerticalOrigin.Page;
            docPicture.VerticalAlignment = ShapeVerticalAlignment.Center;
            docPicture.HorizontalOrigin = HorizontalOrigin.Page;
            docPicture.HorizontalAlignment = ShapeHorizontalAlignment.Center;
            docPicture.HeightScale = percent * 100;
            docPicture.WidthScale = percent * 100;
            docPicture.Title = "AGN" + index;
            docPicture.AlternativeText = imageId;
        }

isoler
 
Posts: 4
Joined: Fri Apr 21, 2017 6:53 am

Mon Apr 24, 2017 3:05 am

Hello,

Thanks for your inquiry and sorry for the late reply as weekend.
Sorry the functionality is not available at present, but i have added the new feature into our schedule. We will keep you informed once there's any update.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Apr 24, 2017 6:21 am

Hello,

thanks for the reply. That's bad news for us as we are using Spire.Doc to replace another product that had this functionality as default. Now people will be aware of the change on the functionality of our app ...

Do you have any planning (release date) of the feature?

isoler
 
Posts: 4
Joined: Fri Apr 21, 2017 6:53 am

Mon Apr 24, 2017 7:40 am

Hello,

Thanks for your quick response.
We do realize the severity of the issue and for this I have informed the relevant team about your concerns, yet I am afraid, at the moment we can't provide the ETA for the feature.
We apologize for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Apr 24, 2017 9:21 am

Hello again,

please keep me informed about any update on the ETA, it is important for us.

Regards

isoler
 
Posts: 4
Joined: Fri Apr 21, 2017 6:53 am

Mon Apr 24, 2017 9:53 am

Hello,

Concerning your urgent situation, we had an initial discussion with our dev team and the news was that the feature might not be accomplished in a short time due to the influence it brought to the relevant xml. One thing to be kindly note, our Spire.Doc just sets the value of "LockAspectRatio" to be true as default.
Once there's any progress on that, we will inform you.
Sorry again for the inconveniencce caused!

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Apr 24, 2017 11:07 am

Hello,

that's not what we are experiencing. With the following code our images have the "Lock Aspect Ratio" setting disabled:

Code: Select all
        private void AddImage(Section documentSection, byte[] imageBytes, float percent, int index, string imageId)
        {
            Paragraph paragraph = documentSection.AddParagraph();
            DocPicture docPicture = paragraph.AppendPicture(imageBytes);
            paragraph.AppendBreak(BreakType.PageBreak);

            docPicture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
            docPicture.VerticalOrigin = VerticalOrigin.Page;
            docPicture.VerticalAlignment = ShapeVerticalAlignment.Center;
            docPicture.HorizontalOrigin = HorizontalOrigin.Page;
            docPicture.HorizontalAlignment = ShapeHorizontalAlignment.Center;
            docPicture.HeightScale = percent * 100;
            docPicture.WidthScale = percent * 100;
            docPicture.Title = index;
            docPicture.AlternativeText = imageId;
        }


And this is the generated document (bloquear relacion de aspecto means Lock Aspect Ratio in Spanish):

Image

isoler
 
Posts: 4
Joined: Fri Apr 21, 2017 6:53 am

Tue Apr 25, 2017 2:46 am

Hi,

Sorry for the mistake.
I have noticed the issue and referred it to our Dev team. In regards to the case, we will provide the hotfix within next week.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed May 03, 2017 7:52 am

Hello,

Glad to inform that your issue has been resolved and now the default aspect ratio value is set to be true, please download the hotfix (Spire.Doc Pack(hot fix) Version:5.9.3) to have a test.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Doc