315 ArgumentOutOfRangeExceptions when Aspose.Pdf.Kit.dll is first used

I’m using PDF Kit v.3.5.0.0, and whenever I call the first method in it, it generates 315 ArgumentOutOfRangeExceptions, which it throws, catches, and ignores internally. This slows down the first usage, and it makes for a terrible experience in the debugger if you have it set to break whenever an exception is thrown.


I’ve attached a simple C# project that demonstrates the problem. It just calls SetPrivilege on an input pdf file. Internally, the Aspose code does some one-time initialization, and it throws an ArgumentOutOfRangeException when it encounters a “;” somewhere. Then it catches the exception and ignores it. The stack trace is shown below. Then this pattern is repeated 315 times!

The performance and debuggability of this would be much improved if the caller would check for the “exceptional” condition (i.e., the “;” value) before calling the code that throws. You could even use a new internal bool method that checks the state and returns false without throwing, since the calling code will just eat the exception anyway. The current implementation is very “unfriendly” to the debugger.


Aspose.Pdf.Kit.dll!xb588f351bb5f458f.x9ffd17ff675cf640.x4785b9e8373ed5c6.xab05c62a2a183f47(char[] x2724c2f362cdd798 = {char[1]}) + 0xf7 bytes

Aspose.Pdf.Kit.dll!xb588f351bb5f458f.x9ffd17ff675cf640.x4785b9e8373ed5c6.x1a52a266eb41c343(string x2724c2f362cdd798 = “;”) + 0x233 bytes

Aspose.Pdf.Kit.dll!xb588f351bb5f458f.x9ffd17ff675cf640.x4785b9e8373ed5c6.x1a52a266eb41c343() + 0x32 bytes

Aspose.Pdf.Kit.dll!xb588f351bb5f458f.x9ffd17ff675cf640.x4785b9e8373ed5c6.x486b28fdf3ff75d9() + 0x49 bytes

Aspose.Pdf.Kit.dll!xeb116a323308e2f7.x56ec8b9e4a16478d.process(xeb116a323308e2f7.x847acb1842aef4c9 rf = {xeb116a323308e2f7.x847acb1842aef4c9}) + 0x112f bytes

Aspose.Pdf.Kit.dll!xeb116a323308e2f7.x56ec8b9e4a16478d.x56ec8b9e4a16478d(string afmFile = “Times-Roman”, string enc = “windows-1252”, bool emb = false, sbyte[] ttfAfm = null, sbyte[] pfb = null) + 0x651 bytes

Aspose.Pdf.Kit.dll!xeb116a323308e2f7.x5d0cbbfd60eaa608.xcd023804d6163926(string xc15bd84e01929885 = “Times-Roman”, string xff3edc9aa5f0523b = “windows-1252”, bool xc0624d0a36ec1ab0 = false, bool x49eca67228b6e281 = true, sbyte[] x9376e30f889d28a7 = null, sbyte[] xa4e61466e4f88ccd = null) + 0x3e8 bytes

Aspose.Pdf.Kit.dll!xeb116a323308e2f7.x5d0cbbfd60eaa608.xcd023804d6163926(string xc15bd84e01929885 = “Times-Roman”, string xff3edc9aa5f0523b = “windows-1252”, bool xc0624d0a36ec1ab0 = false) + 0x53 bytes

Aspose.Pdf.Kit.dll!x30a678191d9b1780.x53863f600a504e05.x4130c8bdf0fc6582(System.IO.Stream x160656af282c4d7b = {System.IO.MemoryStream}, System.IO.Stream x0ecec17af75ebd13 = {System.IO.MemoryStream}, string x319214f212f6cc99 = “”, string x682935b2be2ef7d8 = “”, int xee83661000f1d43d = 2052, bool x30bfe70dc56a69ff = true) + 0x47b bytes

Aspose.Pdf.Kit.dll!Aspose.Pdf.Kit.PdfFileSecurity.x2c82a20d46df9cb6(string x682935b2be2ef7d8 = “”, string xa9cf4de0fffcf1a9 = “”, string xd005ab558c255f3c = “”, Aspose.Pdf.Kit.DocumentPrivilege x8390a7e61fd0335c = {Aspose.Pdf.Kit.DocumentPrivilege}, bool x7f867ab99fcc7ef0 = true) + 0x4e4 bytes

Aspose.Pdf.Kit.dll!Aspose.Pdf.Kit.PdfFileSecurity.SetPrivilege(string userPassword = “”, string ownerPassword = “”, Aspose.Pdf.Kit.DocumentPrivilege privilege = {Aspose.Pdf.Kit.DocumentPrivilege}) + 0x67 bytes

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.