Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Release all object to clear memory

Guest
Nov 24, 2016 Nov 24, 2016

Hello All,

I am using below code (c# .Net) to rotate a page in pdf file and save it

        AcroAVDoc sourceDocument;

        AcroAVPageView pageView;

        AcroPDPage page;

        AcroPDDoc pdfDoc;

 

  sourceDocument.OpenInWindowEx(imageFile,

                                                 this.pdfViewer.Handle.ToInt32(),

                                                 (int)Acrobat.AVOpenParams.AV_EXTERNAL_VIEW,

                                                 1,

                                                 0,

                                                 (short)Acrobat.PDViewMode.PDUseNone,

                                                 (short)Acrobat.AVZoomType.AVZoomFitPage,

                                                 100,

                                                 1,

                                                 1

                                               );

  pageView = sourceDocument.GetAVPageView();

  page = pageView.GetPage();

  short degree = (short)(page.GetRotate() + 90);

   page.SetRotate(degree >= 360 ? (short)(((degree / 90) - 4) * 90) : degree);

  pdfDoc = sourceDocument.GetPDDoc();

  pdfDoc.Save((short)Acrobat.PDSaveFlags.PDSaveFull, imageFile);

  pdfDoc.Close();

And it is working fine.

but now I need to release all objects of acrobat as I need to move this file to another location

but I am not able to do this as is it showing file is already open in another process

I tried some code like below to release object memory

                        sourceDocument.ClearSelection();

                        sourceDocument.Close(1);

                        pdfDoc.Close();

  But it is not working I think AcroPDPage object memory is not releasing properly and still I can see a background task of acrobat in task manager

  please tell me how we can release all objects memory using c#

TOPICS
Acrobat SDK and JavaScript
456
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation