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, "" );
}
FireClickHyperLink event.
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?
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?