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

Free Support Forum - aspose.com

Document constructor with correct password throws Invalid Password exception

I have 2 different PDF documents sent from the same client, both encrypted with the same password, and both can be opened with Adobe using that password. However, one of them fails in the Document constructor with an “Invalid Password” exception. I have tested on both version 20.3, as well as 20.5 with the same results, and same stacktrace (see below).
The code is essentially:
Document document = new Document(filename, “MyPassword”);
document.Decrypt();
For one PDF both lines run successfully; for the other PDF the Document constructor throws the exception with the following stack:
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=zYH54pjiFx3mIJ3OA9UgxJKM=(Object #=z1HYVKdI=)
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=z7fDp9sYPxCve0pcDDAAz5Wg=()
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=zyFXcbYv4L5Y9_EiY8yvpTsWr0273wlICN2oGlV0zfQrI(Object #=z1HYVKdI=, UInt32 #=zxyEUtP4=)
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=zKMWPgq6Kc4pTYvQeTBmRBVA=(Boolean #=z1HYVKdI=)
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=zvQ2YkteJOQVrNe8erl1dQj7whxuE()
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=z$pQikTDi0uA$b5dmKD0X8Co=(Object[] #=z1HYVKdI=, Type[] #=zxyEUtP4=, Type[] #=zQPlRzOQ=, Object[] #=zeM9sqy0=)
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=zO6_YbboKwFi8SEx2mg==(Stream #=z1HYVKdI=, String #=zxyEUtP4=, Object[] #=zQPlRzOQ=, Type[] #=zeM9sqy0=, Type[] #=z1LoBTIw=, Object[] #=zcB4cvVg=)
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=z8Vu6Nf7qGPa5ioBn3Qqf_j8=(Stream #=z1HYVKdI=, String #=zxyEUtP4=, Object[] #=zQPlRzOQ=)
at #=qaQWpfzq5oTJtuJLyafVhdz7WPkAlEQbB9p95LwiVgFs=.#=zx1AjsJ8vszmfyI2TWPN$LIwJOWZfPRm9nw==(Stream #=z1HYVKdI=, String #=zxyEUtP4=, Object[] #=zQPlRzOQ=)
at #=zuuNl9yPi4ZoetNoTda4sCbsAjRgpaJ4sKg==.#=z9p8CRSMg5pJf(String #=zKsCGrVg=, Boolean #=zfhlBpSXIOOaD, StringBuilder #=zlH9virg=, #=zUmJvuVpNNZpr3nxAskzrzB9LdLMHhVBGDgjo2lY= #=z658JpJo=)
at #=zuuNl9yPi4ZoetNoTda4sCbsAjRgpaJ4sKg==…ctor(Stream #=zg6WA7C0=, String #=zKsCGrVg=, Boolean #=zfhlBpSXIOOaD)
at #=zuuNl9yPi4ZoetNoTda4sCbsAjRgpaJ4sKg==…ctor(String #=zjUDDlHU=, String #=zKsCGrVg=)
at #=zb4x1ZjNtomqLO6WKZLqqLSyMfSPbcBdMGcd1irg=.#=z0w8Z0Eg=(String #=zjUDDlHU=, String #=zKsCGrVg=)
at #=z0nRxH8nnCymvjj$s4NqWqAPJo_6qA1CrVQ==…ctor(String #=zjUDDlHU=, String #=zKsCGrVg=)
at #=zb4x1ZjNtomqLO6WKZLqqLSyMfSPbcBdMGcd1irg=.#=zeiUcjWbM2VPU(String #=zjUDDlHU=, String #=zKsCGrVg=)
at #=zgG9RpkKRmJWoa1X6e5nsU7i79j4q.#=ztWsNmO0=(String #=zjUDDlHU=, String #=zKsCGrVg=)
at #=zgG9RpkKRmJWoa1X6e5nsU7i79j4q…ctor(String #=zjUDDlHU=, String #=zKsCGrVg=)
at Aspose.Pdf.Document.#=z8Qu9dwA=(String #=zjUDDlHU=, String #=zKsCGrVg=)
at Aspose.Pdf.Document…ctor(String filename, String password)

@larry.weisberg

Would you kindly share sample PDF document with us along with password. We will test the scenario in our environment and address it accordingly.

@larry.weisberg

Thanks for sharing the sample file in private message.

We were able to reproduce the issue in our environment while using Aspose.PDF for .NET 20.6 and have logged it as PDFNET-48453 in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

Thank you! I am looking forward to the fix.

Hello… I was wondering if there has been progress on this? 3 months ago I took a lot of my own time in order to help you be able to recreate the issue. I hope it was helpful and you were able to fix the bug.

Thanks,
Larry

@larry.weisberg

We really appreciate your cooperation for reproduction of the issue in our environment. Please note that we do realize your concerns and will surely resolve the issue. However, the issues are resolved on first come first serve basis. As soon as review of the logged ticket is done, we will share updates with you within this forum thread. Please give us some time.

We apologize for your inconvenience.