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

Free Support Forum - aspose.com

Table

hello, i have tables in my .doc document model. Is it possible to hide table in the code with aspose.words? thanks for help

Hi,

Thanks for your request. I think currently there is no direct way you can show/hide a complete table using Aspose.Words. A request for this feature has been added so that it could be added in future versions. For reference, your request has been linked to this New Feature Request.

However, I would suggest you the following thread for a possible work around:
https://forum.aspose.com/t/57340

Please let us know if you need more information, We are always glad to help you.

Best Regards,

Hello,
thanks, its works!

But i have another problem, if i hide multiple consecutive tables, there is multiple blank paragraphs.
So i have too much space between tables.

i try this :

Node[] paragraphs = doc.GetChildNodes(NodeType.Paragraph, true).ToArray();
RemoveHiddenContentVisitor hiddenContentRemover = new RemoveHiddenContentVisitor();
foreach (Node paragraph in paragraphs)
{
    if (string.IsNullOrEmpty(paragraph.ToTxt().Trim()) && paragraph.ParentNode != null)
    {
        paragraph.Accept(hiddenContentRemover);
        paragraph.Remove();
    }
}

but it doesnt work, how to do this?

thanks

Hi Julien,

Thanks for your inquiry and sorry for the delayed response. Unfortunately, it is difficult to say what the problem is without the document and code. Could you please attach your input Word document and complete code here for testing? I will investigate the issue further on my side and provide you more information.

Best Regards,

Hello,
thanks for support.
I send you the complete code with model.

You can see the multiple space between tables “EXAMEN ADMINISTRATIF selon TO 110” and “ENVIRONNEMENT ET OPERATIONS PRELIMINAIRES selon TO 110”

Hi Julien,

Thank you for inquiry. First off, please try to use the latest version at your end and see if it resolves your issue. Moreover, i did not observe this problem on my end. I have attached output Pdf file.

I hope, this will help.

Hello,
i try to update aspose.Words but it doesnt change anything.
In your PDf document you can see white space :
look at my screen cap of your pdf, i put red arrows on the space between 2 tables.

Hi Julien,

Thank you for additional information. In this case, you have to wait for the fix of the original issue. We will keep you informed and let you know once it is resolved.

Hi there,

Thanks for your inquiry.

Just as a tip, in the mean time you can work around this problem by removing the hidden tables or rows before conversion.

Please use the RemoveHiddenContent code on the following page to achieve this: https://reference.aspose.com/words/net/aspose.words/specialchar/

Thanks,

Hello,
thank you but i already use this function in my project.
It work for deleting table but not multiple lines

Hi
Julien,

Thanks for the additional information. The vertical space, you’re complaining about, is actually caused by empty Paragraph nodes. May be you can use the following code in order to remove those empty Paragraphs from outside the tables:

Node[] emptyParas = doc.GetChildNodes(NodeType.Paragraph, true).ToArray();

foreach (Paragraph p in emptyParas)
    if (p.GetAncestor(NodeType.Table) == null)
        p.Remove();

I hope, this will help.

Best Regards,

Hello,
Thank you i try but this code remove many tables in my document an add bug spaces between the tables

Hi Julien,

Thanks for your inquiry. May be you can try adjusting vertical space caused by Paragraphs by using ParagraphFormat.SpaceAfter Property and ParagraphFormat.SpaceBefore Property. I hope, this will help.

Best Regards,

The issues you have found earlier (filed as WORDSNET-5549) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan