PDF creator

Good Morning, I would ask gently if exists a way to write on a pdf file with c++. Until now I reach good results to write txt file and some other formats but I'm interesting to create and write on a .pdf file with a c++ code. I read on google about pdfCreatorPilot or some other but without any good results. Now I'm programming in c++ on windows with Microsoft Visual Studio.
Thank you really much
Best Regards
Maybe this is what you want:

http://libharu.sourceforge.net/
thank you very much for the information...I read on the link that nmake compiler is needed. I find on web some information how to get it from visual studio and in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin there is a nmake.exe file. I added the root in the path list but doesn't work. When in cmd I run "nmake -f script/Makefile.msvc" the following error appears: NMAKE: FATAL ERROR u1077 "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe"

secondly when I try to digit nmake --version the following error appears: NMAKE: fatal error U1065: option '-' not found. I read online some forum to solve it but without success.

Can you help me to compile correctly the library? thank you really really much
best regards
Last edited on
nmake is part of visual studio.

Visual studio comes with 'Visual Studio-Tools' (nearby where you start visual studio itself). Withing these tools you find something with Command Prompt. Start it and run nmake from that prompt.
Thank you really much...I'm really sorry but I don't understand what I had to do. In start-->app--> Visual studio there are cmd programs which works in "C:\Program Files (x86)\Microsoft VisualStudio 14.0" and then I digit "nmake -f C:\Users\namepc\Desktop\libharu-2.0.8\script\Makefile.msvc" but at the end appears "NMAKE: fatal error U1073: impossibile to create 'src\hpdf_utils.obj'

I would know if I understood well what you suggested me. thank you very much
So, are starting nmake from the right command prompt?

The problem of that makefile is certainly the wrongful paths. Maybe it suffice to start it from the correct path where actually the Makefile.msvc is. See what this makefile needs.

Isn't there a *.sln file? Then you could compile it from the ide which would be much simplier.
thank you really much for all suggestions. I tried them but I have always the same problem.
After times I tried also to install boardland c++ and use the function make as in the foolowing way:

C:\Users\PC\Desktop\libharu-2.0.8>make -f script/Makefile.bcc
MAKE Version 5.0 Copyright (c) 1987, 1997 Borland International
Fatal: Unable to open makefile

But doesn't work.

In the folder script there are Makefiles with other format: bcc32, bcc32_dll, cygwin, cywin_dll, gcc, gcc_so, in, mingw, mingw_dll, msvc, msvc_dll.

In particular, If you have time to look better the files in the folder is possibile to find all files in the zip folder from the link http://libharu.org/. But I don't want to disturb you excessively.

Until now I thank you very much for all your answers and I will continue to try to succeed.
Best regards
closed account (E0p9LyTq)
Reading http://stackoverflow.com/questions/58730/open-source-pdf-library-for-c-c-application there is an alternative to LibHaru:

http://podofo.sourceforge.net/index.html

PoDoFo has recent updates, LibHaru doesn't.
thank you really much for the suggestions...I tried to compile it already but during compilation there are lots of errors.


C:\Users\PC\Desktop\podofo-0.9.4\build>cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="C:\gnuwin32\include" -DCMAKE_LIBRARY_PATH="C:\gnuwin32\lib" -DPODOFO_BUILD_STATIC=TRUE ..

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
WANT_LIB64 unset; assuming normal library directory names
Will install libraries to C:/Program Files (x86)/PoDoFo/lib
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - not found
-- Looking for winsock2.h
-- Looking for winsock2.h - found
-- Looking for mem.h
-- Looking for mem.h - found
-- Looking for ctype.h
-- Looking for ctype.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for BaseTsd.h
-- Looking for BaseTsd.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long int
-- Check size of long int - done
-- Check size of int64_t
-- Check size of int64_t - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
Both PODOFO_BUILD_SHARED and PODOFO_BUILD_STATIC set
so disabling shared library generation (win32)
Using gcc specific compiler options
Have gcc 4.x
-- Found ZLIB: C:/OpenFOAM/cygwin64/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin/zlib1.dll
Found zlib headers in C:/gnuwin32/include, library at C:/OpenFOAM/cygwin64/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin/zlib1.dll
-- Found LIBCRYPTO: C:/gnuwin32/lib/libcrypto.a
Found OpenSSL's libCrypto headers in C:/gnuwin32/include, library at C:/gnuwin32/lib/libcrypto.a
-- Could NOT find LIBIDN (missing: LIBIDN_LIBRARY LIBIDN_INCLUDE_DIR)
Libidn not found. AES-256 Encryption support will be disabled
-- Found LIBJPEG: C:/gnuwin32/lib/libjpeg.dll.a
Found libjpeg headers in C:/gnuwin32/include, library at C:/gnuwin32/lib/libjpeg.dll.a
-- Found TIFF: C:/gnuwin32/lib/libtiff.dll.a
Found libtiff headers in C:/gnuwin32/include, library at C:/gnuwin32/lib/libtiff.dll.a
-- Found ZLIB: C:/OpenFOAM/cygwin64/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin/zlib1.dll (found version "1.2.3")
-- Found PNG: C:/gnuwin32/lib/libpng.dll.a (found version "1.2.37")
Found LibPng headers in C:/gnuwin32/include;C:/gnuwin32/include, library at C:/gnuwin32/lib/libpng.dll.a;C:/OpenFOAM/cygwin64/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin/zlib1.dll
-- Ensure you cppunit installed version is at least 1.12.0
Cppunit not found. No unit tests will be built.
-- Found OpenSSL: C:/gnuwin32/lib/libssl.a
Found freetype library at C:/gnuwin32/lib/libfreetype.dll.a, headers C:/gnuwin32/include/freetype2;C:/gnuwin32/include
-- Could NOT find Fontconfig (missing: FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
-- Could NOT find Lua50 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
-- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
Lua not found - PoDoFoImpose and PoDoFoColor will be built without Lua support
Building multithreaded version of PoDoFo.
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
Building static PoDoFo library
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/PC/Desktop/podofo-0.9.4/build


I try to solve some of the problems looking online without success.

and I tried to open in visual studio an example coping the helloworld.cpp in a new project..But appears a very long list of errors.

maybe, is possibile to obtain a compiled versione of that or is strictly necessary that the code is compiled on my machine?

yhank you really much and I'm sorry for all this disturb from me :(
thank you.
best regards
Last edited on
Topic archived. No new replies allowed.