How to call PDPageRelease API to release pdf?

New Here ,
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.

Most Valuable Participant
Correct answer by Test Screen Name | Most Valuable Participant

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)

TOPICS
Acrobat SDK and JavaScript

Views

440

Likes

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

How to call PDPageRelease API to release pdf?

New Here ,
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.

Most Valuable Participant
Correct answer by Test Screen Name | Most Valuable Participant

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)

TOPICS
Acrobat SDK and JavaScript

Views

441

Likes

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
Oct 24, 2017 0
Most Valuable Participant ,
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)

Likes

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
Reply
Loading...
Oct 24, 2017 1
New Here ,
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()" ?

Likes

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
Reply
Loading...
Oct 24, 2017 0
Most Valuable Participant ,
Oct 25, 2017

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Oct 25, 2017 1