We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Table truncated in pdf document

Hello Aspose Team,


We are facing issues on some tables in a pdf document. Some tables appear truncated in the pdf document if they contain a long uncut word (while it’s correcting displayed in the word document).
To generate these tables, we use a html file which is append to the Aspose document. The following code is used to set the fit behavior:

Table table = (Table)sourceDoc.getChild(NodeType.TABLE, 0, true);
table.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);

This works fine in the word generated document but not in the same pdf document (table is truncated).

Please find attached a zip file containing both generated documents (word and pdf) and the html file. As you can see on page 2, the table is correctly displayed in the word document but not in the pdf document.

Thanks for your help

Regards
Hi Laurent,

Thanks for your inquiry. Please create a standalone Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. We will investigate the issue on our side and provide you more information.

Hi,


Please find attached a code snippet and files used by this code to reproduce the case.

Regards,
Laurent

Hi,


In addition, we have another behavior if the html table is empty: in the word document, the table fits to the whole page width (ok) but not in the pdf document (just fits to half page width, not ok).

Please find attached the html file to reproduce the bug using the code snippet attached to the previous post.

Thanks for your help.

Regards,
Laurent
Hi Laurent,

Thanks for sharing the detail.
LaurentN:
Table table = (Table)sourceDoc.getChild(NodeType.TABLE, 0, true);
table.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);
We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13886. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.
LaurentN:
In addition, we have another behavior if the html table is empty: in the word document, the table fits to the whole page width (ok) but not in the pdf document (just fits to half page width, not ok).
We have tested the scenario using latest version of Aspose.Words for Java 16.6.0 with following code example. We have not found the shared issue. Please use Aspose.Words for Java 16.6.0.

com.aspose.words.LoadOptions options = new com.aspose.words.LoadOptions();
options.setLoadFormat(com.aspose.words.LoadFormat.
HTML);
com.aspose.words.Document sourceDoc =
new com.aspose.words.Document(MyDir + "Regulations_part2.html",options);

com.aspose.words.Table table = (com.aspose.words.Table)sourceDoc.getChild(com.aspose.words.NodeType.
TABLE, 0, true);
table.autoFit(com.aspose.words.AutoFitBehavior.
AUTO_FIT_TO_WINDOW);

sourceDoc.save(
MyDir + "Out v16.6.0.docx");
sourceDoc.save(
MyDir + "Out v16.6.0.pdf");

Hi Tahir,


Can you please update if we have a fix for the issue WORDSNET-13886 ?

Regards,
Prabhaker Kr.
Hi Prabhaker,

Thanks for your inquiry. We regret to share with you that your issue (WORDSNET-13886) has been postponed due to missing feature WORDSNET-832 (Make table layout as close to Word as possible) which is related to your issue.

After the fix of WORDSNET-832, our product team will look into your issue. We will be sure to inform you via this forum thread as soon as this feature is available.

We apologize for your inconvenience.

Hi Tahir,

Could you please let us know the status for the this issue. if it is fixed, then let us know on which aspose version we can have the soultion.

thanks a lot.

Hi Prabhaker,

Thanks for your inquiry. Your issue is still postponed due to missing feature (WORDSNET-832 - Make table layout as close to Word as possible). We will inform you via this forum thread as soon as there are any further developments.

We apologize for any inconvenience.

Hi Tahir,


Thank you so much the quick response.

As we were tested the issue on Aspose version (Word 16.11.0, PDF 16.10.0). it was working good.
But when we tested with the latest Aspose version(Word 16.12.0, PDF 16.12.0) again we have the same issues.
could you please let us know what might be the reasons to have the issue agian.

Thanks a lot.

Regards
Prabhaker
Hi Prabhaker,

Thanks for your inquiry. We have tested the scenario using Aspose.Words 16.11.0 and noticed the same output. If you are not using the same code shared in this forum thread ("AsposeTest.java"), please share it here for testing along with output pdf that shows the correct output. We will investigate the issue on our side and provide you more information.