Hello,
It seems that much of my formatting settings are lost when saving a WordDocument as a PDF. I have created the document and then called:
document.Save(fileName);
and also done this:
using (DocToPDFConverter converter = new DocToPDFConverter())
{
//Converts Word document into PDF document
using (PdfDocument pdfDocument = converter.ConvertToPDF(document))
{
//Saves the PDF document
pdfDocument.Save(fileName);
}
};
I've attached the two documents so you can see that the table formatting is not being held. Is there a workaround for this?
Hi Natalie,
We have reproduced the problem “Word document with equation is not preserved
properly in Word to PDF conversion”.
|
Word |
|
|
|
|
We
will validate this issue and update you with more details by this weekend.
Regards,
Akash.
Natalie, we have confirmed that the reported issue “Equation
is not aligned properly in Word to PDF conversion” 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 fourth week of January
2024.
The status of this bug can be tracked through the below link:
https://www.syncfusion.com/feedback/49762/equation-is-not-aligned-properly-in-word-to-pdf-conversion
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.”
Natalie, as promised
earlier, we have included the fix for the reported issue with “Equation is not aligned properly in Word to PDF
conversion” in our latest
weekly NuGet release (v24.1.47).
Please use the below link to download our latest weekly NuGet:
https://www.nuget.org/packages/Syncfusion.DocIO.Wpf/24.1.47
The status of this bug task can be tracked through the below link:
https://www.syncfusion.com/feedback/49762/equation-is-not-aligned-properly-in-word-to-pdf-conversion
Note: We will include this fix in our 2023 Volume 4 SP release, which
will be available in the end of January 2024.
Hello,
Please see the attached photo showing a pdf in the syncfusion viewer and a word file made from the same document. While the left alignment of the equations in the "required minimum thickness" section seems to remain, the equations are centered in the pdf which is not correct. Also, the LaTex formatting using the "$" is not handled properly in the pdf. Please advise on how to resolve this issue.
Natalie, we tried to reproduce
the reported problem, but it works properly on our end. For your reference, we
have attached the sample application which we used at our end to reproduce the
reported problem and it can be downloaded from the below attachment.
Can you please try our sample application at your end using your Word document?
If you are still facing the issue means, we suspect that the issue might be due
to the input Word document. So, kindly share the input Word Document to
reproduce the reported issue.
Note: If you have any confidential data in your input Word document,
please replace with some dummy data and provide us the same. We just need your
document to recreate the problem you face. So, once investigated the issue, we
will delete the document permanently from our side and do not share with
anyone.
If you are doing some other process in the
code, please modify the sample attached and share it as issue
reproducible sample.
Regarding: "$" is not handled properly in the pdf.
Kindly share more details about the issue.
1. Input document.
2. Issue screenshot.
3. Output document generated at your end.
4. Code snippet used on you end.
Thereby, we will proceed further to replicate the same problem at our end and
will provide the more details at the earliest.
Attached is the word document that shows the formatting is not maintained when the document is converted to PDF. I have tested the word document in the given WordToPDFEquation solution and have attached the pdf code output as well.
Natalie, we have reproduced the reported
issue with “Equation is not aligned properly in Word to PDF conversion” at
our end. We will validate this issue and update you with more details on 29th
February 2024.
Regarding:
"$" is not handled properly in the pdf:
There
is no “$” present in the given Word document. So, kindly share the input
Word document and a screenshot of the issue. Which will help to reproduce
the reported issue on our side.
Note: If you have any confidential data in your input Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face. So, once investigated the issue, we will delete the document permanently from our side and do not share with anyone.
The dollar sign is used for formatting in the equation. You can see the $ in the pdf where it is in the word document LaTex equation.
The code used when creating the word document is like this:
\eqarray{T_m&= t + c @&=\left(0.7222\right) + \left( 0.175)\right)@&=0.8971 \mathrm{in}}
Natalie, please find the details below.
Regarding: Equation is not aligned properly in Word to PDF conversion.
We are still validating the issue. We will let you know the details by the
start of the next week.
Regarding: "$" is not handled properly in the pdf.
We suspect that the reported issue is the “Unwanted "&" is
preserved in the equation in Word to PDF conversion”. We have reproduced the
mentioned issue on our end. Please find the screenshot below.
We will validate this issue and update you with more details on the start of
the next week.
Please confirm us whether the above issue is the reported issue. If the reported
issue is some other issue, kindly share the screenshot with us. So that we will
proceed further to replicate the same issue on our end.
Yes, that is the issue that I am referring to. Thanks!
Regarding: Equation is not aligned properly in Word to PDF conversion and "$" is not handled properly in the pdf:
On further checking, we have found that the array of equations used in the provided Word document includes the use of "&" within the equations. Microsoft Word aligns equations in an array based on the "&" symbol. Currently, we are checking the Microsoft Word behavior and feasibility of resolving this issue. Further details will be shared within two business days.
Regarding: Equation is not aligned properly in Word to PDF conversion and "$" is not handled properly in the pdf:
On further checking, we've identified a distinct scenario involving the "&" symbol (align and spacer value) within equation arrays in Microsoft Word. Currently, DocIO doesn't support aligning equations based on & symbol in Word to PDF/Image conversion. We considered this request as a new requirement and feature request on our side. We planned to backtrack the complete behavior of this & symbol in the equation array to handle in Word to PDF/Image conversions. At now there is no immediate timeline to implement this feature. We plan to implement this in our upcoming release.
The status of this can
be tracked through the below link:
https://www.syncfusion.com/feedback/51534/align-mathematical-text-of-equation-array-based-on-align-and-spacer-values-during
Can you please provide an estimate of when this feature will be included in a release?
Regarding: Equation
is not aligned properly in Word to PDF conversion and "$" is not
handled properly in the pdf:
As we mentioned
earlier, we don’t have any immediate plans to implement this feature. At the
planning stage for every release cycle, we review all open features. We will
let you know when this feature is implemented.
The status of this can be
tracked through the below link:
https://www.syncfusion.com/feedback/51534/align-mathematical-text-of-equation-array-based-on-align-and-spacer-values-during
Thanks for your reply.
The issue I have now is that when I use this equation:
\eqarray{T_m&= t + c @&=\left(0.7222\right) + \left( 0.175)\right)@&=0.8971 \mathrm{in}}
it is shown as above in the pdf where the "&" sign is still present in the document.
However, if I remove the "&" from the initial equation so that it is:
\eqarray{T_m&= t + c @=\left(0.7222\right) + \left( 0.175)\right)@=0.8971 \mathrm{in}
then, the entire equation is shown on only one line.
Is it possible to make add the equation breaks another way so that the equation is shown on multiple lines but does not include the "&"?
Regarding - it is shown as above in the pdf where the
"&" sign is still present in the document:
If "&" is used within the equations in the Word
document, the Microsoft Word application preserves the space instead of the
"&". Currently, DocIO does not handle this scenario.
Therefore, the "&" is preserved in the converted PDF
document. This problem will be resolved once the below feature is implemented.
We will inform you when this feature is implemented.
The status of this can be tracked through
the below link:
Align mathematical text of equation array
based on align and spacer (&) values during Word to PDF conversion in WPF |
Feedback Portal (syncfusion.com)
Regarding - Is it possible
to make add the equation breaks another way so that the equation is shown on
multiple lines but does not include the "&"?
Yes, it is possible to show the equation on multiple lines without
including the "&" within the equation by adding the "@"
at the end of the equation. Please refer to the equation below:
|
"\\eqarray{T_m= t + c @=\\left(0.7222\\right) + \\left( 0.175)\\right)@=0.8971 \\mathrm{in}@}" |
Unfortunately, we are facing preservation issues while using the above equation
in our DocIO library. We will validate and share further details within two
business days.
Regarding - Is it possible to make add the equation breaks
another way so that the equation is shown on multiple lines but does not
include the "&"?
We have confirmed that the reported issue with “Equation array is not preserved properly
in multiple lines” 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 within two weeks.
The status of this bug can be tracked through the below link: Equation array is not preserved properly in multiple lines in WPF | Feedback Portal (syncfusion.com)
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.
Regarding - Is it possible to make add the
equation breaks another way so that the equation is shown on multiple lines but
does not include the "&"?
As promised earlier, we have included the fix for the reported bug with “Equation
array is not preserved properly in multiple lines” in our latest
weekly NuGet release (v25.1.41).
Root cause of the issue:
The equation array without '&' after '@' was
only partially handled. As a result, the equation array was not split properly.
Please use the below link to download our latest weekly NuGet:
Syncfusion.DocIO.Wpf
The status of this bug task can be tracked
through the below link.
Equation
array is not preserved properly in multiple lines in WPF | Feedback Portal
(syncfusion.com)
Note: We
will include this fix in our 2024 Volume 1 SP release, which will be available
in the beginning of May 2024.
Thank you for this solution.
However, this solution does not allow the equation to be aligned at the '=' on each line of the equation. Is there a solution for that?
Natalia,
as we have mentioned before, Microsoft Word aligns the equations in an array
based on the "&" symbol. Currently, DocIO doesn't support
aligning equations based on “&” symbol in Word to PDF/Image
conversion. We have already logged a feature request “Align mathematical
text of equation array based on align and spacer (&) values during Word to
PDF conversion” in our database. At now there is no immediate timeline to
implement this feature. At the planning stage for every release cycle, we
review all open features. We will let you know when this feature is
implemented.
The status of this can be tracked through the below link:
Align
mathematical text of equation array based on align and spacer (&) values
during Word to PDF conversion in WPF | Feedback Portal (syncfusion.com)