Perhaps I was not clear in the description of the problem. The problem is that the width of the column “Total” of the table is decreased when PDF is generated from the Word document.
However, if the Word document contains the same exact table but no header/footer - the column ‘Total’ in the generated PDF has the same width as in the Word document.
What is the root cause of this difference ?
@oraspose The root cause of the problem has been described above.
When you copy the table into another document in MS Word, most likely it recalculates and updates table grid and the table can be properly rendered by Aspose.Words.
Can you please elaborate on what is incorrect with the table column width?
As far as we can see, the tables appear to be shown correctly in Word. Also, when use Word → SaveAs → PDF, the generated PDF has proper column width for the “Total” column.
The way the grids are shown in the samples attached earlier, they are identical between the one that generated proper PDF (DocWithSomeText_NoHeaderNoFooter.docx) and the one where “Total” column is smaller (DocWithSomeText_HeaderFooterStyles.docx).
The values in the problematic table are invalid and that is why the table is rendered improperly.
As you may know, MS Word documents are flow by their nature. So the consumer application, like MS Word or OpenOffice, reflows the document content into pages on the fly. The same does Aspose.Words when render the document. We are continuously work on improving our document layout engine to make it as close to MS Word as possible. But in this particular case, unfortunately, our layout engine gives incorrect result.
I would have agreed with you, but the same exact values in the table in the other document “DocWithSomeText_NoHeaderNoFooter.docx” produced proper PDF as expected.
Can you please explain what is causing this difference?
@oraspose There are many aspects that can affect the table layout. Some runs in the problematic tables have advanced typography features (ligatures). Without advanced typography, content metrics are not considered reliable and Aspose.Words uses values that are specified in tblGrid, that is in this particular case are invalid.
Please see attached zip file containing the following:
DocWithSomeText_NoHeaderNoFooter - input document without any header or footer;
25_1_output_DocWithSomeText_NoHeaderNoFooter.pdf - output PDF
DocWithSomeText_HeaderFooterStyles - input document with some text and a footer;
25_1_output_DocWithSomeText_HeaderFooterStyles.pdf - output PDF
We attempted to use aspose-words-25.1-shaping-harfbuzz-plugin on Linux 7 and Linux8 platform and got the following error:
Aspose.Words native libs cannot be loaded. /tmp/AsposeNative/Shaping.Harfbuzz/1738867303848/libharfbuzz-shaping-engine-dll.so: /lib64/libm.so.6: version `GLIBC_2.35' not found (required by /tmp/AsposeNative/Shaping.Harfbuzz/1738867303848/libharfbuzz-shaping-engine-dll.so).
On Linux platforms we have Glibc 2.17.
Linux 7:
ldd ./libharfbuzz-shaping-engine-dll.so
./libharfbuzz-shaping-engine-dll.so: /lib64/libm.so.6: version `GLIBC_2.35' not found (required by ./libharfbuzz-shaping-engine-dll.so)
./libharfbuzz-shaping-engine-dll.so: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by ./libharfbuzz-shaping-engine-dll.so)
./libharfbuzz-shaping-engine-dll.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./libharfbuzz-shaping-engine-dll.so)
linux-vdso.so.1 => (0x00007ffce58e9000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007ffa78c9e000)
libm.so.6 => /lib64/libm.so.6 (0x00007ffa7899c000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ffa78786000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffa783b8000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffa78fa6000)
Linux 8:
$ ldd libharfbuzz-shaping-engine-dll.so
./libharfbuzz-shaping-engine-dll.so: /lib64/libm.so.6: version `GLIBC_2.35' not found (required by ./libharfbuzz-shaping-engine-dll.so)
./libharfbuzz-shaping-engine-dll.so: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by ./libharfbuzz-shaping-engine-dll.so)
linux-vdso.so.1 (0x00007fffd53a1000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8504347000)
libm.so.6 => /lib64/libm.so.6 (0x00007f8503fc5000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8503dac000)
libc.so.6 => /lib64/libc.so.6 (0x00007f85039d6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f85046dc000)
We have tried legacy plugin aspose-words-25.1-shaping-harfbuzz-legacy-plugin.jar and got unsatisfied link error, now with GLIBC_2.33 library. Below is stack trace:
java -cp .:commons-io-2.11.0.jar:commons-lang3-3.12.0.jar:aspose-words-25.1.jar:aspose-words-25.1-shaping-harfbuzz-legacy-plugin.jar TestWordToPDF
Aspose.Words native libs cannot be loaded. /tmp/AsposeNative/Shaping.Harfbuzz/1738949577572/libharfbuzz-shaping-engine-dll.so: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/AsposeNative/Shaping.Harfbuzz/1738949577572/libharfbuzz-shaping-engine-dll.so)
Aspose.Words native libs cannot be loaded. /tmp/AsposeNative/Shaping.Harfbuzz/1738949577572/libharfbuzz-shaping-engine-dll.so: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/AsposeNative/Shaping.Harfbuzz/1738949577572/libharfbuzz-shaping-engine-dll.so)
Aspose.Words native libs cannot be loaded. /tmp/AsposeNative/Shaping.Harfbuzz/1738949577572/libharfbuzz-shaping-engine-dll.so: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/AsposeNative/Shaping.Harfbuzz/1738949577572/libharfbuzz-shaping-engine-dll.so)
Feb 07, 2025 5:32:57 PM com.aspose.words.shaping.internal.zzXXP zzX2i
SEVERE:
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.aspose.words.shaping.harfbuzz.HB.hb_buffer_create(I)J
at com.aspose.words.shaping.harfbuzz.HB.hb_buffer_create(Native Method)
at com.aspose.words.shaping.harfbuzz.zzY30.<init>(Unknown Source)
at com.aspose.words.shaping.harfbuzz.zzXK1.zzY30(Unknown Source)
at com.aspose.words.shaping.harfbuzz.zzXK1.zzY30(Unknown Source)
at com.aspose.words.shaping.harfbuzz.zzXK1.shapeText(Unknown Source)
. . .
. . .
@oraspose
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSJAVA-3031
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Quick question - is this additional plugin aspose-words-25.1-shaping-harfbuzz-legacy-plugin.jar covered by the same license as aspose-words package ?
Thank you.
We re-tested the issue using the downgraded harfbuzz legacy plugin on Linux7 platform and it seems the issue WORDSJAVA-3031 still exists.
See attached screenshot.
Thank you.
@oraspose The minimum required GLIBC version used by HarfBuzz in Aspose.Words for Java is 2.33 (for HarfBuzz Legacy). Unfortunately, earlier versions of HarfBuzz that could work with older GLIBC versions are unavailable in the current build system. To use the shaping-harfbuzz-legacy-plugin, you must either upgrade GLIBC to version 2.33 or, if this is not feasible or advisable, implement containerization as an alternative solution.
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.