If I try to perform document conversion on a password-protected document (for example a password-protected .docx file), the call never returns, as far as I can tell. Is there any way to have the conversion time-out? Obviously I can put the call on another thread and kill the thread after a certain time, but that is rather inelegant. Also since the conversion seems to be performed in a service rather than in-process, will that leave the service in an awkward state?
JR VanMechelen
Document Conversion for document with password
Re: Document Conversion for document with password
Support · Dec 6, 2013Hello JR,
The Converter uses MS Office to open Office documents before it converts them to PDF. As MS Office does not time out or return an error message if no password is entered, it is not possible for Converter to detect what Office is doing at that point. Hence our product cannot handle password protected documents at this time. Please make sure not to send any password protected documents to Converter for converting. Our developers are looking for ways to elegantly handle this kind of scenario and we will post an update as soon as we have a solution ready.
Thanks,
ceTe Software Support Team.
Re: Document Conversion for document with password
Forum member · Dec 9, 2013We don't have any strong way to prevent our users from uploading files with passwords. In general they are clever enough not to do so, but the fact that the code locks up inside your conversion process is somewhat awkward.
I can suggest some approaches we used in developing something similar. As I recall, at least with Word you can pass in an empty string as password. For files that don't have a password, this is ignored. For files with a password this will fail immediately with an error for the mis-matched password. The problem with passing in a empty string password is that some files are partially-password-protected. They can be opened for reading without a password, but need a password to be changed. If you pass in a password with these files they assume you are trying to open them for edit, and fails immediately.
As a generalization of the above, you could add a password parameter to your interface. Then you can let the application developer pass in blank passwords if that is what needs to be done.
Because of the partially-protected files, our ultimate solution was to not pass in the password, but instead to have a timeout. If processing exceeded this timeout, we killed the COM server. With some Office products this was easier than others. With Word and Excel, as I recall, it was relatively easy to get the COM server process id and kill the server. With others it was relatively hard, and our solution was not guaranteed to work 100% correctly. It's a fairly blunt solution to the problem but it was the best we could think of.
JR VanMechelen
Re: Document Conversion for document with password
Support · Dec 9, 2013Hello JR,
Thanks a lot for these suggestions. We will forward your feedback to our development team.
Thanks,
ceTe Software Support Team.