Hello and thank you for the prompt reply.
My system:
- Visual Studio 2010
- Aspose.Pdf.Kit for .NET 5.5.0.0
- Windows 7 Professional sp1 64 bit
- Intel Core 2 Duo @ 2.10 GHz
- 4GB RAM
I attached the full test project. It may help because, in it, you can choose number of scanned pages to create (it just coppies the same page over and over). I included a sample image file (in bin folder) as well. Then it tries to create a bookmark. After certain number of pages, it fails. I hope this will help you to narrow the source of the problem.
Client’s sytem is XP Pro. Don’t know how much RAM they have.
Again, my requirement is to be able to create bookmarks in PDFs. There will be at least one long pdf per day with more then 500 pages.
Please help.
Here is the actual error.
---------------------------------------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at xfc3c9f4b173edcf4.xf2b3414d8422e470.Write(Byte[] b, Int32 offset, Int32 length)
at System.IO.BufferedStream.Flush()
at System.IO.BufferedStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at xfc3c9f4b173edcf4.x29772c3c37b291f5.parseCOSStream(xee8436665878406c dic, Stream file)
at xfc3c9f4b173edcf4.x5aaee8f48ef4defd.x30f085f1ccc05ade()
at xfc3c9f4b173edcf4.x5aaee8f48ef4defd.parse()
at xfc3c9f4b173edcf4.x830721144d567671.xed2598a30006f85f(Stream xcdaeea7afaf570ff)
at Aspose.Pdf.Kit.PdfBookmarkEditor.x14a9fa2bb6069fed()
at Aspose.Pdf.Kit.PdfBookmarkEditor.CreateBookmarks(Bookmark bookmark)
at ThickFile.Form1.btnBookmark_Click(Object sender, EventArgs e) in C:\usr\project\Sjgh-2010\ThickFile\Form1.cs:line 60
at ThickFile.Form1.btnPdf_Click(Object sender, EventArgs e) in C:\usr\project\Sjgh-2010\ThickFile\Form1.cs:line 48
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 (RTMGDR.030319-2200)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
ThickFile
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///P:/Sjgh-2010/ThickFile/bin/Debug/ThickFile.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Aspose.Pdf
Assembly Version: 5.0.1.0
Win32 Version: 5.0.1.0
CodeBase: file:///P:/Sjgh-2010/ThickFile/bin/Debug/Aspose.Pdf.DLL
----------------------------------------
System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Aspose.Pdf.Kit
Assembly Version: 5.5.0.0
Win32 Version: 5.5.0.0
CodeBase: file:///P:/Sjgh-2010/ThickFile/bin/Debug/Aspose.Pdf.Kit.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at xfc3c9f4b173edcf4.xf2b3414d8422e470.Write(Byte[] b, Int32 offset, Int32 length)
at System.IO.BufferedStream.Flush()
at System.IO.BufferedStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at xfc3c9f4b173edcf4.x29772c3c37b291f5.parseCOSStream(xee8436665878406c dic, Stream file)
at xfc3c9f4b173edcf4.x5aaee8f48ef4defd.x30f085f1ccc05ade()
at xfc3c9f4b173edcf4.x5aaee8f48ef4defd.parse()
at xfc3c9f4b173edcf4.x830721144d567671.xed2598a30006f85f(Stream xcdaeea7afaf570ff)
at Aspose.Pdf.Kit.PdfBookmarkEditor.x14a9fa2bb6069fed()
at Aspose.Pdf.Kit.PdfBookmarkEditor.CreateBookmarks(Bookmark bookmark)
at ThickFile.Form1.btnBookmark_Click(Object sender, EventArgs e) in C:\usr\project\Sjgh-2010\ThickFile\Form1.cs:line 60
at ThickFile.Form1.btnPdf_Click(Object sender, EventArgs e) in C:\usr\project\Sjgh-2010\ThickFile\Form1.cs:line 48
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 (RTMGDR.030319-2200)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
ThickFile
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///P:/Sjgh-2010/ThickFile/bin/Debug/ThickFile.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Aspose.Pdf
Assembly Version: 5.0.1.0
Win32 Version: 5.0.1.0
CodeBase: file:///P:/Sjgh-2010/ThickFile/bin/Debug/Aspose.Pdf.DLL
----------------------------------------
System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.225 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Aspose.Pdf.Kit
Assembly Version: 5.5.0.0
Win32 Version: 5.5.0.0
CodeBase: file:///P:/Sjgh-2010/ThickFile/bin/Debug/Aspose.Pdf.Kit.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.