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

Free Support Forum - aspose.com

Issues with password-protected files in Aspose.Slides 14.10.0

Hi,

Tested newest Aspose.Slides.dll (14.10.0) before including it my project and got some issues.

Issue 1

NullReferenceException is thrown when I try to open password-protected PPTX file.

I attached PPTX file. Sample code:

new Presentation(@"pptx.pptx", new LoadOptions() { Password = "1" })
The same with POTX, PPSM, PPSX, PPTM, PPTX.

PPT, PPS, POT are opened successfully (without exception being thrown).


Issue 2

Aspose.Slides.PptReadException (Couldn't read "PowerPoint Document" record.) is thrown when I try to open password-protected PPS file and does not provide password. InvalidPasswordException must be thrown.

File attached. Code sample:
new Presentation(@"pps.pps")


Issue 3

PptxUnsupportedFormatException is thrown when I try to open password-protected PPT/POT file and does not provide password. InvalidPasswordException must be thrown.

File attached. Code sample:
new Presentation(@"ppt.ppt")


Issue 4

I repoted it before in some ticket. If you try to open DOCX file with Presentation class, exception is thrown with the following text: Not a Microsoft PowerPoint 2007 presentation.

And it seams OK, but Aspose.Slides is obfuscated and the name of exception type is obfuscated too, so I do not even know what type to use in catch statement (except general Exception class of course).

Thanks,
Alex Shloma

Hi Deepak,

I have worked with the presentation files shared by you using Aspose.Slides for .NET 14.10.0 on my end. For issue 1, I have been able to observe the NullReference exception on accessing pptx.pptx when correct password is provided. An issue with ID SLIDESNET-36039 has been created in our issue tracking system to investigate and resolve the issue.

For issues 2 and 3, I have been able to observe the InvalidPasswordException, which is right behavior and also the same has been requested by you.


For issue 4, concerning to loading of word document, I have been able to observe the issue and have added a ticket with ID SLIDESNET-36040 in our issue tracking system to provide appropriate exception message. This thread has been linked with both issues so that you may be automatically notified once the issues will be resolved.

We are sorry for your inconvenience,


Hi,

It’s my fault.


I provided wrong code snippet for issue #2 and #3. Another constructor must be used.

Correct code:

// Issue #2
try{ new Presentation(@“pps.pps”); }
catch(PptReadException){}

// Issue #3
try { new Presentation(@“ppt.ppt”); }
catch (PptxUnsupportedFormatException) { }

try { new Presentation(@“pot.pot”); }
catch (PptxUnsupportedFormatException) { }

Best regards

Hi Deepak,

I have observed your requirements and have created an issue with ID SLIDESNET-36041 in our issue tracking system to further investigate and resolve the issues for PPT, PPS and POT presentations. This thread has been linked with the issues so that you may be automatically notified once the support will be available.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-36039) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Tested. Issue #1 is fixed.


How about others? Is there any progress?

Thanks,
Alex Shloma

Hi Alex Shloma,


I have verified from our issue tracking system and regret to share that the issues are still unresolved. We will share the good news with you as soon as the pending ones will also get resolved.

Many Thanks,

Hi


Any progress since 03-10-2015 6:11?

Thanks,
Alex

Hi,


I have observed your comments. Our product team is investigating this issue in detail, We will share good news with you soon.

Best Regards,

Tested issues on Aspose 17.4. Cannot replicate. Seems that bugs were fixed.


Can you please also check on your side too?

Alex

Found another issue: Slides is unable to open OOXML formats (POTX, PPSM, PPSX, PPTM, PPTX) if password-to-open is specified.


The following exception is thrown: Aspose.Slides.PptxUnsupportedFormatException. The file is ZIP archive. It can be Microsoft PowerPoint 2007 PPTX presentation.

new Presentation(“ppsm.ppsm”, new Aspose.Slides.LoadOptions { Password=“123” });

I understand that file is not encrypted (has no password-to-open) and that file is ZIP, but think better logic would be to simply ignore password in LoadOption object and open presentation.

To test please create empty PPTX file in MS Office.

Thanks,
Alex

Hi Alex,


I have observed your comments. I like to share that the issue seems resolved as Aspsoe.Slides is now throwing UnSupportedFormat exception for DOCX file when correct password is given. Also, it give InvalidPasswordException when loading a word file with wrong password. Please share feedback with us if there is still an issue.

Best Regards,

No, old issues are fixed and can be closed.


But please consider scenario that I described in the previous post.

Hi Alex,

I have observed your following requirements:

licenses@litera.com:
Found another issue: Slides is unable to open OOXML formats (POTX, PPSM, PPSX, PPTM, PPTX) if password-to-open is specified.

The following exception is thrown: Aspose.Slides.PptxUnsupportedFormatException. The file is ZIP archive. It can be Microsoft PowerPoint 2007 PPTX presentation.

new Presentation(“ppsm.ppsm”, new Aspose.Slides.LoadOptions { Password=“123” });

I understand that file is not encrypted (has no password-to-open) and that file is ZIP, but think better logic would be to simply ignore password in LoadOption object and open presentation.
Alex


I like to share that the correct approach to do this is to first verify if presentation is encrypted or not without even loading the presentation. If the presentation is encrypted then you can use LoadOptions with password. Otherwise, you can load presentation without setting any password. The following sample code will be helpful in your implementation.


bool ifEncrypted=PresentationFactory.Instance.GetPresentationInfo(“Test.pptx”).IsEncrypted;

Presentation testPres =null;

Aspose.Slides.LoadOptions opts = new Aspose.Slides.LoadOptions();

opts.Password = “123”;


if (ifEncrypted)

{

testPres = new Presentation(“Test.pptx”,opts);

}

else

{

testPres = new Presentation(“Test.pptx”);

}

Many Thanks,

Nice. Did not know about PresentationFactory calss. I did search for “util” class for this purpose based on my experience with Words and Cells.


Thanks, will test and reach back to you if I find any issues.

Alex
Tested PresentationFactory.Instance.GetPresentationInfo method.

I have to files (attached): PPT and PPS. Both are write protected. IPresentationInfo.IsEncrypted returns different values. TRUE for PPT, and FALSE for PPS.

Is it OK? If yes, can you please explain? Understanding of such things is required to use Aspose.Slides intelligently.

Thanks,
Alex

Hi Alex,

I have observed the information shared and have also worked with PPT file shared by you. You have only shared PPT presentation that I have verified using IPresentationInfo.IsEncrypted for read protection. It return true for your shared presentation and also I am able to open the presentation in readonly mode inside PowerPoint. This behavior is right as IPresentationInfo.IsEncrypted for verifying the read protection for any presentation.

If there is otherwise result with PPS file on your end for which you have set read protection as well but Aspose.Slides return false for that. Then please share the PPS file with us as well for investigation on our end along with password for file.

Many Thanks,

Hi.

Probably I made mistake. Cannot replicate issue when IPresentationInfo.IsEncrypted returning FALSE for write-protected PPS presentation.

Have some questions about the following:
Mudassir:
... This behavior is right as IPresentationInfo.IsEncrypted for verifying the read protection for any presentation.


You say that method is used to identify whether presentation is read-protected. But method returns TRUE for write-protected legacy presentations (read-only presentations with password to modify).

I understand, that PowerPoint may encrypt stream(s) inside compound file (OLE package) of write-protected legacy formats (Word and Excel don't do it). And that might have been the reason why IsEncrypted is TRUE for write-protected (read-only) legacy formats.

So I suggest:
  • leaving IsEncrypted property as is. It will signal any kind of encryption inside presentation (related to read-protection or to write-protection);
  • adding 2 more properties: IsReadProtected and IsWriteProtected to IPresentationInfo.

IsReadProtected will return true only for presentations that are read-protected (password to open is required).

IsWriteProtected will be 3-state enumeration:
  • True - for OOXML an legacy presentations that have only write-protection (read-only presentations);
  • False - for OOXML and legacy formats that have neither read nor write protection;
  • Unknown - for OOXML or legacy format that are read-protected (password to open is required). As presentation is entirely encrypted there is no way to check if it is write protected.

Thanks,
Alex

Hi Alex,

I have considered your suggestion related to support for identifying read protected and write protected presentation decks. An issue with ID SLIDESNET-38923 has been created in our issue tracking system as new feature request to investigate the possibility of implementing requested support. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESNET-38923) have been fixed in this update.