We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Rotated Images when converting from Word to PDF

We are trying to convert a Word document to a PDF.  Some of the images inside of the document are landscape.  Inside of the word doc, they are rotated 270 degrees to be in portrait orientation.  After converting, the don't render correctly on the page.  They are off center.  If I manually save the image, rotate, and reinsert into the document, everything looks correct.  Unfortunately, doing this isn't a long term option, as the documents are provided to us by a 3rd party.  

I've attached some screenshots of the documents.

Syncfusion.DocIO.NET.Core: v17.3.0.34
Syncfusion.DocIORenderer.Net.Core: v17.3.0.34



using (var converter = new DocIORenderer())
{
converter.Settings.ChartRenderingOptions.ImageFormat = ExportImageFormat.Jpeg;
converter.Settings.EmbedFonts = true;
converter.Settings.PreserveFormFields = true;
var pdfDocument = converter.ConvertToPDF(wordDocument);

using (var outStream = new FileStream(outfile, FileMode.Create))
{
pdfDocument.Save(outStream);
outStream.Flush(true);
outStream.Close();
pdfDocument.Close(true);
}
}

Attachment: Page1Of2_6dc1cc30.zip

5 Replies

VA Vijayasurya Anandhan Syncfusion Team December 11, 2019 10:39 AM UTC

Hi Rick,

Thank you for contacting Syncfusion support.

We have checked the reported issue by creating a simple word document with rotated image and converting it to PDF, but it is working fine in our end.
 
For more reference, please find the sample which we have tried in our end to reproduce the issue from the following link.
https://www.syncfusion.com/downloads/support/forum/149824/ze/Rotated_image1541738503.zip
 
We suspect that the reported issue might be specific to the input Word document. So, could you please provide us the input Word document along with the complete code snippets which used at your end by modifying the above sample to reproduce the exact problem. Thereby we will analyze further and provide you the appropriate solution at the earliest. 
Note: If you have any confidential data in your Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face in your end. 
 
Regards, 
Vijayasurya A




RS Rick Stephens December 11, 2019 02:18 PM UTC

Vijayasurya,

Thank you for your reply.  Please see the attached document to reproduce the issue.

Attachment: fromscratch_546e7ec.zip


RS Rick Stephens December 11, 2019 02:30 PM UTC

It looks like it's the text wrapping settings that causes the rendering issues.  Anything but "In Line with Text" has undesirable results.  Square results in my original issue where "Tight" results in the image in it's original orientation.  It looks like there are lots of bugs around orientations still.  


VA Vijayasurya Anandhan Syncfusion Team December 12, 2019 08:55 AM UTC

Hi Rick,

Thank you for your details.

We can reproduce the issue with "
Picture with rotation and text wrapping is not preserved properly in the generated PDF” from our side and suspect it be a defect. We will validate this issue and update you with more details on 16th December 2019. 
  
Please let us know if you have any queries. 

Regards,
Vijayasurya A



MK Madhan Kumarasamy Syncfusion Team December 16, 2019 05:11 PM UTC

Hi Rick,

Thank you for your patience.

We confirmed the issue “
Picture with rotation is not aligned properly while converting a Word document to PDF” as a defect. We have logged a defect report. This fix will be included in our 2019 Volume 4 sp1 which will be available in mid of January 2020 tentatively.

Note: If you want patch for defect then kindly let us know the currently installed version, so that we can provide a patch in that version based on our SLA policy.

Please let us know if you need any further assistances in this.

Regards,
Madhan k
 


Loader.
Live Chat Icon For mobile
Up arrow icon