The PDFTron.NET.x64 SDK fails to read a .docx file located in the OneDrive folder when keeping to open the file with MS Word

Product: PDFTron.NET.x64

Product Version: 10.12.0.2

Environments: .NET 8.0.2, Windows 10/11 64bit, MS Office 2019/2021

I developed an app to convert a .docx file to a PDF file using PDFTron.NET.x64 SDK 10.12.0.2.
The PDFTron.NET.x64 SDK fails to read a .docx file located in the OneDrive folder when keeping to open the .docx file with MS Word.

But, when I close the MS Word and run the same case, the SDK works fine for converting to a PDF file.
Also, when the .docx file is located in the local drive and I keep to open the .docx file with the MS Word, the SDK works well.

I think that the above problem occurs because the OneDrive service locks the files with the exclusive access.
Anyone can reproduce this problem by using the sample code included in the PDF SDK.

I need a solution to avoid this problem.
Please help me.

Thanks.

Does this happen with other apps?

For example, under the same condition, can you use 7zip to unzip the docx?

If the file is locked enough to prevent read access, then there isn’t anything PDFNet can do.

I need a solution to avoid this problem.

Perhaps you can copy the file to a temp location.

Yes, this happens with other apps such as 7zip:

Perhaps you can copy the file to a temp location.

I think so, too.

Thanks very much for your suggestion.
Best regards.