FireClickHyperLink event.

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
sath
Posts: 5
Joined: Tue Nov 15 2005

FireClickHyperLink event.

Post by sath »

Hi,

I click on a hyperlink and that hyperlink will open another pdf document.
I use the FireClickHyperlink event.

Whenever I click on the link I get the following exception. Any clues ?

Here is the stack trace.

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="acPDFCreatorLib.Net"
StackTrace:
at b(x3* , t2* , Int32 )
at k(x3* , UInt32 , UInt32 , Int32 , Int32* )
at a(x3* , aje* , UInt32 , UInt32 , Int32 , Int32* , UInt32 )
at e(aje* , UInt32 , UInt32 , Int32 )
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at TestProgram.Main() in

--------------------------------------------------------------------------------------

I wrote the following code opens the PDF document.

using( FileStream stream = new FileStream( filePath, FileMode.Open ) )
{
_pdfViewer.Enabled = true;
_pdfViewer.Document.Open( stream, "" );
}
sath
Posts: 5
Joined: Tue Nov 15 2005

Post by sath »

I am using .net framework 2.
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

I unfortunately do not have .Net 2.0 installed but the code snippet below function correctly in .net 1.1.

Can you verify this on your end?

private int pdfCreator1_FireClickHyperlink(object sender, Amyuni.PDFCreator.IacEventArgs e)
{
string filePath = "c:\\temp\\sample.pdf";

using( FileStream stream = new FileStream( filePath, FileMode.Open, FileAccess.Read, FileShare.Read ) )
{
pdfCreator1.Enabled = true;
pdfCreator1.Document.Open( stream, "" );
}
return 0;
}

Hope this helps?
Post Reply