Unable to Set ‘VBASigned’ Property to ‘False’ to Disable Macros and Protect PPTX File

I am able to export PPT. Here I need help for one of the task - The system shall set the ‘VBASigned’ property to ‘False’ to disable macros in the aspose PPT using aspose pdf library and Set the password for ppt and protect the password , I did not find code references for disable the macros and protect with aspose PDF drawing packages, Can you please help me to give property to disable macros in code while exporting ppt?

@Sukhvinder

Would you please share your sample PDF with us along with sample code snippet that you are using to convert the document? Also, please share your expected sample output document for our reference so that we can test the scenario in our environment and address it accordingly.

@asad.ali Here I am attaching sample code for convert html string to stream and then opening stream with Document object of Aspose.PDF library, then assigning the header, footer and slides then save document on specific path with stream and save format with PPTX format and also attached sample output of PPTX file which generating with attached code.
We require Disable the macro and encrypt with password generated PPTX file , Can you please help here ? Code is here -pptgeneratecode.PNG (106.1 KB)

Generated File is here -SummaryReport.zip (785.7 KB)

HTML template string - htmltemplate.zip (240.9 KB)

Let me know if you require any other information.

I am open for live session , where I can share my screen and let you know the issue.

@Sukhvinder

Aspose.PDF is specialized to deal with PDF format and its conversion into different API formats. In case you need to apply some setting on PPTX file, you should use Aspose.Slides. So we are moving your inquiry to Aspose.Slides category where you will be further assisted accordingly.

@asad.ali As per attached snapshot,aspose pdf.PNG (41.0 KB)
Aspose PDF already support for PPTX format and we have already raise one of form request (Aspose.PDF Running .NET 6 project in Docker throws Globalization.CultureNotFoundException after deployment on linux - #12 by Sukhvinder) where we got to now It is working fine for PPTX with Aspose PDF and here also we are able to get required PPTX file with aspose pdf library and we have already raise request for aspose pdf license So we required support here to Disable the macro and password applies on the pptx file.

@Sukhvinder,
I am working on the issue you described and will get back to you as soon as possible. Thank you for your patience.

@Sukhvinder,
The VBASigned property in PowerPoint documents cannot be changed. It is a read-only property.

Please note: Macros can be disabled in the PowerPoint application, but not for a specific PowerPoint document.

If you have a PowerPoint document with macros (PPTM file, for example), you can easy save it to a PPTX file. The result document will not contain macros.

using (var presentation = new Presentation("example.pptm"))
{
    presentation.Save("example.pptx", SaveFormat.Pptx);
}

You can also remove a specific macro from a PPTM file using the IVbaProject interface like this:

using (var presentation = new Presentation("example.pptm"))
{
    var firstModule = presentation.VbaProject.Modules[0];
    presentation.VbaProject.Modules.Remove(firstModule);

    presentation.Save("example_output.pptm", SaveFormat.Pptm);
}

To protect a presentation with a password, you should use the IProtectionManager interface like this:

using (var presentation = new Presentation("example.pptx"))
{
    presentation.ProtectionManager.Encrypt("my_password");
    presentation.Save("encrypted.pptx", SaveFormat.Pptx);
}