Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VBA 64 call pdfium.dll crash #172

Open
loquat opened this issue Jul 29, 2024 · 1 comment
Open

VBA 64 call pdfium.dll crash #172

loquat opened this issue Jul 29, 2024 · 1 comment

Comments

@loquat
Copy link

loquat commented Jul 29, 2024

the latest version PDFium 128.0.6611.0
windows x64
Public Declare PtrSafe Function FPDF_LoadDocument Lib "pdfium" (ByVal file_path As String, Optional ByVal Password As String) As LongPtr
Public Declare PtrSafe Sub FPDF_CloseDocument Lib "pdfium" (ByVal hPDF As LongPtr)
Public Declare PtrSafe Function FPDF_GetPageCount Lib "pdfium" (ByVal hPDF As LongPtr) As Long
Public Declare PtrSafe Sub FPDF_InitLibrary Lib "pdfium" ()
Public Declare PtrSafe Sub FPDF_DestroyLibrary Lib "pdfium" ()

Public Function pdfium_GetPages(ByVal sPath As String) As Long
Dim hPDF As LongPtr
Dim bytBuff() As Byte
StrToUTF8 sPath, bytBuff 'convert sPath to UTF8 array
FPDF_InitLibrary
hPDF = FPDF_LoadDocument(bytBuff(0))
If hPDF Then
pdfium_GetPages = FPDF_GetPageCount(hPDF)
FPDF_CloseDocument hPDF 'Excel crashs here
End If
FPDF_DestroyLibrary
End Function

@loquat
Copy link
Author

loquat commented Jul 29, 2024

office 365 x64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant