views:

302

answers:

2

Hi,

I am having a problem using the PrintImage function of the ActivePDF C# library. When I use it to try to place a .gif image on the PDF I receive this error message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I am able to use the PrintJPEG and PrintTIFF image functions without any problem. Has anyone run into this problem before?

A: 

Is that image coming from a picturebox or similar control? If that's the case, then that control has a lock on that image (I ran into the same situation while trying to serialize an object that contained an image from an inkpicture control). You would need to copy the image before placing it in your pdf document.

SnOrfus
The picture is uploaded via a FileUpload control on a web form. I am able to upload jpg/tif and use them, just not anything that uses the generic PrintImage.
Rick
If that's the case, then sorry, I'm not really sure what the problem could be. It still sounds like something has a lock on the image but I wouldn't know where to go from here.
SnOrfus
A: 

I know this is an old thread, but did you ever find an answer to this?

Recently our app pools have been crashing all the time, citing ActivePDF:

Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

StackTrace:    at APToolkitNET.ToolkitWrapper.APTK_Destroy(Int32 zToolkit)
   at APToolkitNET.Toolkit.Finalize()

It happens every so often and we have to recycle the app pool. Any ideas on what's causing this? We recently upgraded to v4.999

LoveMeSomeCode