I have a Docx template with a this table header:
when I create the Docx result, I create new columns in the middle and I remove some borders to get this result:
But, when I convert it to a PDF file, the result looks like this:
Is there any trick to create the same table in PDF?
Hi Jon,
We have attempted to replicate the reported query by creating a Word
document with a table as shown in the screenshot. Please find the attached Word
document that we have converted to PDF. We suspect that this preservation issue
may be specific to the input Word document. Therefore, we recommend that you
share the Word document from your end so that we can reproduce the exact issue.
This will allow us to analyze it further and provide you with the appropriate
solution as soon as possible.
Regards,
Dharanitharan A
Sorry for the delay, but I can't find your attached file. On the other hand, here is our doc file (only the table) that gives us these problems. Thanks for you help!
Jon,
We have tried to reproduce the reported problem using the given Word document, but
it works properly in latest product version (v25.2.7) at our end. For your
reference, we have attached the sample application which we tried to reproduce
the reported problem at our end.
Please refer to the below screenshot of output PDF document generated at our
end:
|
|
We suggest you to try the attached sample at your end and provide us
confirmation whether you are facing issue in this sample.
If the issue is not reproduced using the attached sample application at your
end, then could you please modify the attached sample as an issue
reproducible sample application and share it with us.
Could you please provide us the modified sample of above and let us know
the product version used in your end, which will be helpful to
reproduce the exact issue at our end.
Based on the above details, we will check and provide you appropriate solution
at the earliest.
Jon,
Please find the sample application which we tried to reproduce the reported problem at our end.
Thanks Suriya, with your solutions works well. I had this another development to convert from word to pdf:
using WordDocument wordDocument = new (wordDocumentStream, FormatType.Automatic);
using DocIORenderer renderer = new ();
renderer.Settings.ChartRenderingOptions.ImageFormat = Syncfusion.OfficeChart.ExportImageFormat.Png;
using PdfDocument pdfDocument = renderer.ConvertToPDF(wordDocument);
pdfDocument.Save(pdfDocumentStream);
and I was using these imports:
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="22.2.7" />
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="22.2.7" />
Now, I changed to use only "Syncfusion.DocToPDFConverter.WinForms", but I get always this error:
"Error message from GraphQL execution, message : Unexpected Execution Error , exception: Could not load file or assembly 'Syncfusion.Licensing, Version=22.2460.7.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4'. The system cannot find the file specified. , stack : at Syncfusion.DocIO.DLS.WordDocument..ctor()\r\n at Syncfusion.DocIO.DLS.WordDocument..ctor(Stream stream, FormatType type)"
But I can't understand because the project is compiling well and I see the Licensing dependency also in the project:
So, what do you think I'm missing?
Jon, initially,
we suspected that your application platform was WinForms, which is why we only
shared the application with "Syncfusion.DocToPDFConverter.WinForms"
NuGet package. But, from your latest previous update, we discovered that your
application platform is actually ASP.NET Core.
To resolve the reported issue, we recommend that you uninstall the
“Syncfusion.DocToPDFConverter.WinForms” and install the
Syncfusion.DocIORenderer.Net.Core (Version="26.1.35") NuGet in
your ASP.NET Core application and let us know whether the table now preserved
properly or not.
|
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="26.1.35" /> |
Regarding - I changed to use only
"Syncfusion.DocToPDFConverter.WinForms", but I get always this error:
"Could not load file or assembly 'Syncfusion.Licensing’”:
We have found that you have installed the Syncfusion.DocToPDFConverter.WinForms
NuGet packages in your .NET Core targeting application.
Our Syncfusion License are version and platform
specific. So, that the reported problem occurs at your end. To resolve this
issue, we recommend that you use the corresponding NuGet packages in your
application based on the platform.
Please refer to our User Guide documentation to find out which NuGets need to
be installed in your application based on the platforms.
NuGet Packages for .NET Word (DocIO) library | Syncfusion
Hi Team, with
Syncfusion.DocIORenderer.Net.Core (Version="26.1.35") I have 2 problems: It continues showing the tables incorrectly and my license is invalid.
I did some tests with my older versions:
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="22.2.7" />
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="22.2.7" />
My Code generates first a Word Document and then creates the PDF document based on a MemoryStream. When I do this the PDF file is getting those incoherences. But, if manually I open the doc file and save it in another document without changing anything, and then creating a PDF file based on this new doc file, the result is OK as expected.
Please, I need help to know what is different in those 2 doc files, becase with one of them my program is creating the PDF correctly. The files looks like equals, but the correct one has higher size, but I don't know how to see the differences.
I attached both doc files.
Tell me if you see something I can do in my code to create the correct doc file.
Jon,
Regarding – “Table not preserved properly while converting a DOCX to PDF”:
We have reproduced the reported problem “Table not preserved properly while
converting a Word to PDF” on our end with your given Word document “example_incorrect.docx”.
We will validate this issue and update you with more details on mid of next week.
Regarding – “My license is invalid with Syncfusion.DocIORenderer.Net.Core
(Version="26.1.35")”
If you have upgraded the Syncfusion NuGet packages to a latest release version,
you should generate and update the respective version license key also.
Syncfusion License keys are version and platform specific. So, you should
generate and register corresponding version license key in your application.
Also, please ensure that all the referenced Syncfusion assemblies\NuGet
packages are on the same version of the license key’s version to resolve the
reported license problem.
To know more about licensing. Please refer the following UG link.
https://help.syncfusion.com/file-formats/licensing/licensing
Find the below details to know about generating license key,
https://help.syncfusion.com/file-formats/licensing/generating-license-keys
Find the below details to know about registering license key,
https://help.syncfusion.com/file-formats/licensing/registering-license-keys
Thank you team. I will be waiting for your update.
Regards,
Jon.
Jon, on further analysis, we have found Microsoft Word application
resizes the column when opening the Word document in viewer. It doesn’t
maintain any information about the column width in the file level for this
scenario. So, we need some more time to backtrack the behavior. We will
validate and share the details within two days.
ok, thanks.
Jon, we have confirmed that the reported issue with "Table with
horizontal merge cells is not preserved properly while converting a DOCX to
PDF” is a defect and we have logged a defect report. We will include the
fix for this defect in our weekly NuGet release, which is estimated to be
available on three weeks.
The status of this bug can be tracked through the below link:
https://www.syncfusion.com/feedback/58900/table-with-horizontal-merge-cells-is-not-preserved-properly-while-converting-a
Disclaimer: Inclusion of this solution in the weekly release may change due to
other factors including but not limited to QA checks and works
reprioritization.
Jon, as we have
promised earlier, we have included the fix for the reported issue with “Table
with horizontal merge cells is not preserved properly while converting a DOCX
to PDF” in our latest weekly NuGet release (v26.1.41).
Root cause of the issue:
In the provided input document, the merge start cell does not have preferred width.
Therefore the horizontal merge cells are not preserved properly.
Please use the below link to download our latest weekly NuGet:
Syncfusion.DocToPdfConverter.AspNet.Mvc5
The status of this bug can be tracked through the below link:
https://www.syncfusion.com/feedback/58900/table-with-horizontal-merge-cells-is-not-preserved-properly-while-converting-a
Note: We will include this fix in our 2024 Volume 2 service pack
release, which will be available at the end of July 2024.
Many thanks, team, I will be waiting for this enhancement!