Community

[FREngine 12] How to properly deinitialise IEngine?

Hi,

I am new to FRE and am wondering how to properly deinitialise the IEngine in the following scenario.

 

In Windows, we extract the dll and call IEngine.load while for other OS we directly call IEngine.InitializeEngine.

 

I can see there's Unload and DeinitializeEngine. Just want to know whether we just need to call DeinitializeEngine in both case or we do Unload for Windows and DeinitializeEngine for the other?

Thank you very much in advance.

 

Andy

0

Comments

1 comment

  • Avatar
    Koen de Leijer

    Hi Andy

    We also work with Java on both Linux and Windows,
    I have never used the Unload method, we rely on DeinitializeEngine

    Best regards

    Koen de Leijer

        private IEngine engine = null;

        public void Run(String inputfilename, String dllFolder, String developerSn, String languages) throws Exception {
           
            // Load ABBYY FineReader Engine
            engine = Engine.GetEngineObject(dllFolder, developerSn);

            try {
                // Setup ABBYY FineReader Engine
                print("Loading ABBYY predefined profile");
               
                String profile = "DocumentConversion_Accuracy";
                engine.LoadPredefinedProfile(profile);

                // Process PDF
                processPDF(inputfilename);
            } catch (Exception ex) {
                ex.printStackTrace();
            } finally {
                // Unload ABBYY FineReader Engine
                print("Deinitializing ABBYY Engine...");
                engine = null;
                Engine.DeinitializeEngine();
            }
        }

    0
    Comment actions Permalink

Please sign in to leave a comment.