So I have:
Doc 1 (text with font size = 11)
Doc 2 (table with font size = 11)
Inserting Doc 2 into Doc 1 and get:
Doc 3 (text with font size = 11 + table with font size = 12)
When I try to force font size in table to e.g 10 , size is changing correctly:
for (Object runObject : table.getChildNodes(NodeType.RUN, true)) {
Run run = (Run)runObject;
Font font = run.getFont();
double currentSize = font.getSize();
font.setSize(10);
}
But even if I will try to force to font size in table to 11 - it is changing to 12 again.
Do you have any idea how can I handle this?
Please feel free contact me if you need any more details.
Please ZIP and upload your input Word documents and Aspose.Words generated output DOCX file showing the undesired behavior here for testing. Please also provide piece of source code that you are using to insert one Word document into another. We will then investigate the issue on our end and provide you more information.
You can observe this behavior when executing the following simple code:
Document outerDoc = new Document("E:\\Temp\\asposeTest\\outerDoc.docx");
Document innerDoc2 = new Document("E:\\Temp\\asposeTest\\innerDoc2.docx");
DocumentBuilder builder = new DocumentBuilder(outerDoc);
builder.moveToDocumentEnd();
builder.insertDocument(innerDoc2, ImportFormatMode.KEEP_SOURCE_FORMATTING);
outerDoc.save("E:\\Temp\\asposeTest\\awjava-20.1.docx");
Also, when you copy the target Table to ‘outerDoc.docx’ manually by using MS Word 2019, you will observe the same behavior. So, this seems to be an expected behavior. Please let us know if we can be of any further assistance.
@awais.hafeez,
yes it’s true, that simple code above will bring me the same result.
However please see attached screenshot: wordBehavior.png (14.2 KB)
When I choose “Paste Options” -> Keep Source Formatting, then fonts in pasted table are changing to correct (size 11). I’m using Word 2016.
But it’s bit strange, because my code (and yours code) have ImportFormatMode.KEEP_SOURCE_FORMATTING flag.
What do you think, maybe downgrade to some prev version of library can help me? I will try to do some more tests with Word 2019 soon. I’ll let you know.
Thanks for the additional information. We have logged this problem in our issue tracking system. Your ticket number is WORDSNET-19927. We will further look into the details of this problem and will keep you updated on the status of the linked issue. We apologize for your inconvenience.
Thank you for attention to this matter. I cross my fingers and wish you good luck in investigation. Please let me know once find a solution or workaround.
Thanks in advance.
@awais.hafeez, thank you for your effort, I really appreciate.
What do you think, when we can expect any update on this ticket?
It would be nice to have High Level Estimation, just to adjust my own timelines. Would it be fays or months or quarters?
Thank you very much.
I am afraid, we are currently doing analysis of this issue to determine the root cause. There are no estimates available at the moment. Once the analysis of this issue will be completed, we may then be able to share the ETA of this issue with you. We apologize for your inconvenience.
Regarding WORDSNET-19927, it is to update you that if everything goes by plan, we are very hopeful to integrate the fix of this issue in the 20.3 (or in worst case scenario 20.4) version of Aspose.Words for Java. We will inform you via this thread as soon as a version containing the fix of your issue will be released in future. Thanks for your understanding and being patient.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.