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.

Tue Feb 27, 2018 10:28 am

Hallo,
We have a commercial license for Spire.Doc for .NET and we've found another issue related to the same process for which we've previosuly opened this thread https://www.e-iceblue.com/forum/issue-with-tables-when-converting-docx-to-pdf-t7270.html which, in the meanwhile, has been solved (thanks again, by the way).
The problem is related to images in tables. In the original .docx file (created by Word) we have a table with a single cell and an image in it. The image is aligned at the center of the cell.
When we convert the .docx file to pdf the image is aligned to the left. Of course we want to the image to keep the center alignment assigned in the original .docx.
Please find attached the source .docx file and the resulting .pdf file (Please note that the attached pdf is the result of a print to pdf operation of the original pdf generated by Spire.Doc. This has been made to create a pdf file with just the page where the error occurs).

You can find below the very simple code we use:

Spire.Doc.Document doc = new Spire.Doc.Document();
string fullpath = Path.Combine(HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["PATHFILETEMPLATE"].ToString()), "default", "doc di partenza.docx");
doc.LoadFromFile(fullpath);
doc.SaveToFile(fullpath.Replace(".docx", ".pdf"), Spire.Doc.FileFormat.PDF);

Basically to show you the problem, we just open an existing docx file and then save IT as PDF.
Thanks in advance for your support.
Matteo Bruzzese

igeam_ssi
 
Posts: 6
Joined: Mon Oct 23, 2017 10:55 am

Wed Feb 28, 2018 2:36 am

Dear Matteo,

Thanks for your inquiry.
I have tested your case with the latest Spire.Doc Pack(hot fix) Version:6.2.3, the result is correct, you could check it in the attachment. Please try to use this version.
If the issue still exists on your side after using the latest version, first please check whether the input Word document you provided is the correct, and provide OS/Region information for further investigation, e.g. Win7 64bit, China/Chinese.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Mar 02, 2018 9:57 am

Dear Matteo,

Greetings from E-iceblue.
Has your issue been resolved ? Could you please give us some feedback at your convenience ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Mar 14, 2018 6:09 pm

Dear Betsy,
we've just tried today after having installed the new release 6.3.0, but we get the same issue when converting a .docx file to pdf, that is the image at the center of a table is aligned to the left in the resulting pdf.
Is there some other way we can show you the issue or help you to reproduce it?
Best regards.
Matteo

igeam_ssi
 
Posts: 6
Joined: Mon Oct 23, 2017 10:55 am

Thu Mar 15, 2018 2:49 am

Dear Matteo,

Sorry to hear that the issue still exists.
Firstly, please make sure the input Word you provided is the original file without any change. Then provide following information to help us reproduce your issue on my side.
1. The result pdf generated by Spire.Doc 6.3.0.
2. OS/Region information, e.g. Win10 64bit, Italy(My testing environment).
3. The type of your project, e.g. MVC
4. Did you deploy on Azure or other place ? If so, could you get correct result on the local ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc