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

Steps to use this library on an swift package for iOS? #70

Open
zocario opened this issue Mar 9, 2022 · 2 comments
Open

Steps to use this library on an swift package for iOS? #70

zocario opened this issue Mar 9, 2022 · 2 comments

Comments

@zocario
Copy link

zocario commented Mar 9, 2022

Hello, I tried using your library to build an iOS package.

For that I've downloaded the dylib files for arm64 and x86 and created an xcframework using this command:
xcodebuild -create-xcframework -library ./pdfium-ios-arm64/lib/libpdfium.dylib -headers ./pdfium-ios-arm64/include -library ./pdfium-ios-x64/lib/libpdfium.dylib -headers ./pdfium-ios-x64/include -output ./pdfium.xcframework

Then I've modified the package.swift file of my package to include the framework as binary target:

  ...
    targets: [
        .binaryTarget(name: "PDFium", path: "artifact/pdfium.xcframework"),
    ]
   ...

The project compiles, runs, but when I tried to open a document nothing is happening.. no crash but I have the error FPDF_ERR_FILE. While using an other library with .a binaries I don't have the same issue so I'm wondering if I missed anything while generating the framework? Do you have a documentation to include those binaries in a swift package?

Thanks!

@bblanchon
Copy link
Owner

Hi @zocario,

FPDF_ERR_FILE suggests that the library is working but cannot read the PDF file.

I never used this library in a Swift project, but maybe @TcT2k (who wrote the build of macOS) did.

Best regards,
Benoit

@TcT2k
Copy link
Contributor

TcT2k commented Mar 11, 2022

FPDF_ERR_FILE suggests that the library is working but cannot read the PDF file.

I never used this library in a Swift project, but maybe @TcT2k (who wrote the build of macOS) did.

Sorry I don't have any experience with Swift.

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

No branches or pull requests

3 participants