Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Apr 19, 2023 3:51 pm

Hi, setting Hidden appearance is not working on Java for me.
I use:
Code: Select all
    public void testHide() throws FileNotFoundException {
       Document document = new Document(new FileInputStream(new File("C:\\Users\\User\\Downloads\\document.docx")));
       hideSdt(document.getChildObjects());
       document.saveToFile("C:\\Users\\User\\Downloads\\document_hide.docx");
    }

    public void hideSdt(DocumentObjectCollection documentObjectCollection) {
        for (int i = 0; i < documentObjectCollection.getCount(); i++) {
            if (documentObjectCollection.get(i).getDocumentObjectType() == DocumentObjectType.Structure_Document_Tag)
                ((StructureDocumentTag) documentObjectCollection.get(i)).getSDTProperties().setAppearance(SdtAppearance.Hidden);
            else
                hideSdt(documentObjectCollection.get(i).getChildObjects());
        }
    }


But in document content control still with box.
When I change in word its working fine.

We use spire.doc:11.3.0

Thanks,
Andrei Chorin

andrei.chorin
 
Posts: 68
Joined: Sun Jan 08, 2023 2:36 pm

Thu Apr 20, 2023 10:11 am

Hi,

Thank you for your inquiry.

I have reproduced the issue that setting Hidden appearance is not working using Spire.Doc for Java. I have recorded this issue in our issue tracking system with issue ID SPIREDOC-9317.

Our development team will conduct further investigation and fix it as soon as possible. We will keep you updated once we have any updates. We apologize for any inconvenience this may have caused

Sincerely,
Ella
E-iceblue support team
User avatar

Ella.Zhang
 
Posts: 42
Joined: Fri Apr 07, 2023 7:42 am

Fri Apr 21, 2023 9:00 am

Hi,

Thank you for your patience.

Our development team has completed the investigation of issue SPIREDOC-9317. It was found that the feature to set a hidden border in a content control is supported starting from Word 2013. To enable this feature, please save the document using the FileFormat.Docx_2013 option when saving the file.

Please refer to the following code:

Code: Select all
document.saveToFile("filename", FileFormat.Docx_2013).


If you have any further questions, please feel free to contact us. We would be happy to help you.

Sincerely,
Ella
E-iceblue support team
User avatar

Ella.Zhang
 
Posts: 42
Joined: Fri Apr 07, 2023 7:42 am

Sun Apr 23, 2023 6:36 am

Thanx a lot.

andrei.chorin
 
Posts: 68
Joined: Sun Jan 08, 2023 2:36 pm

Mon Apr 24, 2023 1:22 am

Hi,

If you have any further questions, please feel free to contact us. We'd be happy to help you.

Sincerely,
Ella
E-iceblue support team
User avatar

Ella.Zhang
 
Posts: 42
Joined: Fri Apr 07, 2023 7:42 am

Return to Spire.Doc

cron