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

How to call PDPageRelease API to release pdf?

Guest
Oct 24, 2017 Oct 24, 2017

Copy link to clipboard

Copied

Here is my code.

Public Function GetPDFLastTwentyText(ByVal pstrPdfFilename As String) As String 
     Dim PDDoc As Object
     Dim CAcroRect As New Acrobat.AcroRect
     Dim PDPage As Acrobat.AcroPDPage
     Dim PDTxtSelect As Acrobat.AcroPDTextSelect
     Dim CArcoPoint As Acrobat.AcroPoint
     Dim iNumWords As Integer
     Dim iMax As Long
     Dim arPdfLines() As String
     Dim i As Integer
     Dim fso As FileSystemObject
     GetPDFLastTwentyText = ""
     Set fso = New FileSystemObject
     If fso.FileExists(pstrPdfFilename) Then
          Set PDDoc = CreateObject("AcroExch.PDDoc")
          PDDoc.Open pstrPdfFilename
          Set PDPage = PDDoc.AcquirePage(PDDoc.GetNumPages() - 1)
          Set CArcoPoint = PDPage.GetSize()
          CAcroRect.Top = CArcoPoint.y
          CAcroRect.Left = 0
          CAcroRect.Right = CArcoPoint.x
          CAcroRect.bottom = 0
          Set PDTxtSelect = PDDoc.CreateTextSelect(PDDoc.GetNumPages() - 1, CAcroRect)
          ...
          PDDoc.Close
     End If 
    
     Set fso = Nothing
     Set PDTxtSelect = Nothing
     Set CAcroRect = Nothing
     Set CArcoPoint = Nothing
     Set PDPage = Nothing
     Set PDDoc = Nothing 
End Function

I have no idea to use this API.

Although I call API directly "PDPageRelease (PDPage)" in my code, it will get error that it can't find this API.

TOPICS
Acrobat SDK and JavaScript

Views

921

Translate

Translate

Report

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

correct answers 1 Correct answer

LEGEND , Oct 24, 2017 Oct 24, 2017

That is part of the plugin API. You cannot use this in an external app. Why do you want to use it? (In a plugin it is vital, yes)

Votes

Translate

Translate
LEGEND ,
Oct 24, 2017 Oct 24, 2017

Copy link to clipboard

Copied

That is part of the plugin API. You cannot use this in an external app. Why do you want to use it? (In a plugin it is vital, yes)

Votes

Translate

Translate

Report

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
Guest
Oct 24, 2017 Oct 24, 2017

Copy link to clipboard

Copied

Because I want to delete the pdf file, the pdf file will lock after this program.

So i can't use this api "PDPageRelease()" just like other api "AcquirePage()" ?

Votes

Translate

Translate

Report

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
LEGEND ,
Oct 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

LATEST

If you want to delete the file, its best to quit Acrobat.

Votes

Translate

Translate

Report

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