Hey there,

we get an AccessViolationException when trying to access the ImageDocument of an FRPage after moving pages between documents and removing some of the documents. We only get this Exception after using one of AddImageFile-methods to fill pages to our documents. We do not get this exception if we use the PrepareAndOpenBitmap() / PrepareAndOpenImage() method.

We even know this KB article: Abbyy KB article 1565 All calls to the FREngine are made from same thread (same id) and thread state is always STA.

Our code looks like this:

   List<FRDocument> allDocuments = new List<FRDocument>();

   //Create passwordCallback, _Engine and prepareMethod

   FRDocument doc1 = _Engine.CreateFRDocument();
   doc1.AddImageFileWithPasswordCallback("filePath", passwordCallback, prepareMode, null);
   FRDocument doc2 = _Engine.CreateFRDocument();


   int i = 0;
   FRPage page = doc1.Pages.Item(i);
   ImageDocument imDoc = doc2.Pages.Item(0).ImageDocument; //Here the exception is thrown

We would avoid this error by using the PrepareAndOpenBitmap() method in our code but this doesn't seem to support password protected pdf documents.

Do you have some hints? Thanks for your help.

asked 21 Nov '13, 16:54

Philipp%20Eger's gravatar image

Philipp Eger

The issue should be solved if you firstly call


and then


answered 21 Nov '13, 19:05

Anastasia%20Galimova's gravatar image

Anastasia Ga... ♦♦

Thanks for your answer. We tried your solution, but unfortunately the exception is still thrown. We wonder that this behaviour doesn't occur if we get a reference by the return value of PrepareAndOpenBitmap().

Maybe there is some way to use PrepareAndOpenBitmap() for password protected PDFs to avoid this error?

(22 Nov '13, 14:55) Philipp Eger

Unfortunately we did not manage to repeat your issue.

In order we could have a better look at the issue and give you appropriate recommendations, please send us the simple sample project, instructions how to run it, image you process and an AInfo report to SDK_support@abbyy.com.


answered 28 Nov '13, 14:20

Julia%20Anikushina's gravatar image

Julia Anikus... ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 21 Nov '13, 16:54

Seen: 1,843 times

Last updated: 17 Jan '14, 09:16

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal