jack wrote:could you list the steps you took to build pdfium?
Thank you for your great reply. I am lloking at it now. To answer your question I did it through Git similar to yours following the instructions here:
https://pdfium.googlesource.com/pdfium/
I run these commands from Bash Terminal (El Capitan and XCode 6.1.1):
1. git clone
https://chromium.googlesource.com/chrom ... _tools.git
2. export PATH=`pwd`/depot_tools:"$PATH"
3. mkdir repo
4. cd repo
5. gclient config --unmanaged
https://pdfium.googlesource.com/pdfium.git
6. gclient sync
7. cd pdfium
8. gn gen pdfbuild
9. gn args pdfbuild
This opens Vim automatically and I insert these lines:
is_debug = false
is_component_build = false
is_official_build = true
pdf_enable_xfa = false
pdf_enable_v8 = false
pdf_is_standalone = true
clang_use_chrome_plugins = false
Then I save and close Vim and the build continues. Following instructions from:
https://github.com/pvginkel/PdfiumViewe ... ing-PDFium
I edit BUILD.gn in the /repo/pdfium folder as follows except the last one - I di not add pdfiumviewer.cpp:
In the section config("pdfium_common_config"):
Add the following include path to the include_dirs list: "v8/include";
Add the following define to the defines list: "FPDFSDK_EXPORTS";
Change static_library("pdfium") to shared_library("pdfium") to build a shared library;
And lastly I go into the pdfbuild folder and run:
ninja pdfium
It builds about 400++ files including the libpdfium.dylib but which is only 4KB. If I build the whole project which is about 1400++ files the libpdfium.dylib is about 20MB. And if I add [target_CPU = "x64"] in the args.gn file it builds more (i forget how many files) and the libpdfium.dylib is 50MB.
But they all don't work. Either OpenLibrary does not open them or it opens them and gives an IMA on _FPDF_InitLibrary. I am trying to run the example code given by acreis here:
http://www.purebasic.fr/english/viewtop ... 68#p500068
It works perfectly in Windows!
I am going to try your suggestions now. Thank you.
