내 코드는 다음과 같습니다.PDPageRelease API를 호출하여 pdf를 릴리스하는 방법은 무엇입니까?
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
이 API는 사용할 수 없습니다.
PDPageRelease()
그리고이 API에 대한 공식 문서가 있습니까?
다음은 adobe의 API 문서에있는 설명입니다.
PDPage PDDocAcquirePage (PDDoc의 문서, ASInt32 pageNum)는
문서로부터 PDPage를 취득. 페이지의 참조 카운트를 증가시킵니다. 페이지를 사용하여 을 완료 한 후 PDPageRelease()를 사용하여 페이지를 해제합니다. PDPageRelease()가 호출되지 않으면 페이지가 닫히는 이 포함 된 문서를 차단할 수 있습니다. 이러한 문제를 방지하려면 범위를 벗어나 페이지가 해제되도록 CSmartPDPage 클래스를 사용하십시오.
"AcquirePage"를 호출 한 후에이 API를 호출해야합니다.