2

Has anyone ever setup lib haru on the iPhone and can tell me how to get it to work. I know there is a sample project on github (http://github.com/akisute/iPhonePDF) which uses the haru lib for creating a pdf. But I just can not figure out how to get the library to work.

What I did so far:

  • First I copied the support folder of the sample project on github
  • I added the two static libraries haru and png.
  • Then I added the linked libraries for both.
  • I also added the framework libz

When I try building it, I get the error can not find library -lharu

Do I need to install it first, I really do not have any clue? I never tried to include a C Library into my iPhone project before.

Thanks a lot for any kind of hint.

Darren
  • 68,902
  • 24
  • 138
  • 144
jagse
  • 333
  • 4
  • 18

1 Answers1

1

I've just installed it in XCode 4:

  • In the iPhonePDF's folder downloaded from http://github.com/akisute/iPhonePDF you have a support folder with the libharu and the libpng folders inside. The trick here is the files you copy to your project. Delete the script files and, specially, the file named pngtest.c from the libpng folder.

  • Once you have the folders "clean", you can add them to your project and it will compile.

Ruben Marin
  • 1,639
  • 14
  • 24
  • Can you please elaborate on this? //Delete the script files// Also can you share if we have to set any paths in project settings? Can you share your folder structure? Thanks in advance – KishoreK Apr 28 '11 at 14:45
  • With script files I refer to `Makefile.am` and `Makefile.in`. If you don't remove them you'll have a huge crack when compiling. I only had to copy the libpng and libharu folders (after deleting that Makefiles) to my project (drag & drop the folders for example in a "PDFGeneration" group inside your project in XCode. And then compile and it should work! – Ruben Marin Apr 28 '11 at 15:31
  • You may also need to add the -lz flag to the "Other Linker Flags" on your target. http://stackoverflow.com/a/289294/416622 – Andrew Kozlik Oct 17 '12 at 01:33
  • @Ruben Esposito: I am not finding any make files in libpng and libharu folders .Its giving me many compiler errors – Raj Oct 26 '12 at 12:11
  • can any one tell me ,is it possible to convert html to pdf using libharu ? – Raj Oct 29 '12 at 05:26
  • Does libharu generate the pdf in Japanese language by default ? How to translate it to English ? – Raj Oct 29 '12 at 05:32