Picture-filled textboxes exported properly in PDF, but empty in DOC

Good day,

for an exported document we are scanning the document for textboxes containing certain placeholders, for simplicity's sake let's call it @Image@. All text boxes with this placeholder are supposed to be filled with a background image and the placeholder text will be removed, so a user's content may be exported.
When we export as .pdf this works fine, but in .doc we receive empty textboxes with the removed placeholder. In the .doc file the text box's fillstyle is set as 'None'.


   Private Sub FillTextboxWithUserImage(textBox As WTextBox, paragraph As IWParagraph)
            Dim profileImage = GetProfileImage(*some parameters, this part works*).ProfileImage
            Dim backup As Image = New Bitmap(profileImage)
            paragraph.Text = ""
            textBox.TextBoxFormat.FillEfects.Type = BackgroundType.Picture
            textBox.TextBoxFormat.FillEfects.Picture = profileImage

            ResizeTextboxToImageRatio(textBox, backup)
        End Sub

 Private Sub ResizeTextboxToImageRatio(textBox As WTextBox, sourceImage As Image)
            Dim imageRatio As Double = sourceImage.Width / sourceImage.Height
            If textBox.TextBoxFormat.Width < textBox.TextBoxFormat.Height Then
                textBox.TextBoxFormat.Height = textBox.TextBoxFormat.Width / Convert.ToSingle(imageRatio)
            Else
                textBox.TextBoxFormat.Width = textBox.TextBoxFormat.Height * Convert.ToSingle(imageRatio)
            End If
        End Sub

We are a bit lost right now, as nothing in the above functions seems off and it works flawlessly in the .pdf version, which obviously is generated from the same document. Is there a bug we do not know about? Our customers are getting very angry at us by now, but we don't know how to get it running. Do we maybe need to change a setting?

1 Reply

PK Prakash Kumar D Syncfusion Team October 25, 2018 09:33 AM UTC

Hi Alexander, 
 
Thank you for contacting Syncfusion support. 
 
We have tried to reproduce the reported issue with picture-filled textboxes are not proper in Doc format, but it works as expected. Kindly share us the following details which will be helpful for us to reproduce the issue and provide a prompt solution. 
 
1.      Essential Studio product version & platform. 
2.      Input & output documents. (Both DOC, PDF) 
3.      Complete code snippet or sample. 
 
Please let us know If you have any queries. 
 
Regards, 
Prakash Kumar 


Loader.
Up arrow icon