Название: PDF чтение и запись
Отправлено: digwnews от Июль 18, 2011, 17:29
Как в Qt можно создавать pdf документы? Смотрел библиотеку poppler, но не понимаю как мне её подключить к Creator. Или может быть есть какие-то совсем простые решения, нужно всего лишь создать пдф документ с заданным текстом.
Название: Re: PDF чтение и запись
Отправлено: QNik от Июль 18, 2011, 17:43
Для записи используйте класс QPrinter. Вот пример http://doc.qt.nokia.com/4.7/qprinter.html#isValid
Можно печатать сразу из многострочного текстового поля с помощью метода QTextEdit::print() http://doc.qt.nokia.com/4.7/qtextedit.html#print
Название: Re: PDF чтение и запись
Отправлено: digwnews от Июль 24, 2011, 14:41
Отлично. Запись получилась. А извлечь текст просто из пдф можно каким-нибудь средством? Или нужно писать своё или ковырять xpdf?
Название: Re: PDF чтение и запись
Отправлено: QtCoder от Июль 25, 2011, 09:56
почитай в моем блоге о работе с PDF через библиотеку PoDoFo.
http://qtcoder.blogspot.com/2010/06/pdf-qt.html (http://qtcoder.blogspot.com/2010/06/pdf-qt.html) http://qtcoder.blogspot.com/2010/06/pdf-podofo-0.html (http://qtcoder.blogspot.com/2010/06/pdf-podofo-0.html) http://qtcoder.blogspot.com/2010/06/pdf-unicode.html (http://qtcoder.blogspot.com/2010/06/pdf-unicode.html)
Название: Re: PDF чтение и запись
Отправлено: Andrew Vladoff от Сентябрь 22, 2011, 20:33
почитай в моем блоге о работе с PDF через библиотеку PoDoFo.
http://qtcoder.blogspot.com/2010/06/pdf-qt.html (http://qtcoder.blogspot.com/2010/06/pdf-qt.html) http://qtcoder.blogspot.com/2010/06/pdf-podofo-0.html (http://qtcoder.blogspot.com/2010/06/pdf-podofo-0.html) http://qtcoder.blogspot.com/2010/06/pdf-unicode.html (http://qtcoder.blogspot.com/2010/06/pdf-unicode.html)
пробовал собрать как вы писали под VS 2008 но не получается: Сам bat файл: del cmakecache.txt set FTDIR=C:\Work\3rd\freetype-2.3.9 set FTLIBDIR=C:\Work\3rd\freetype-2.3.9\objs\win32\vc2008 set JPEGDIR=C:\Work\3rd\jpeg-8c set ZLIB_LIBRARY=C:\Work\3rd\zlib114\dll32\zlib.lib set ZLIB_INCLUDE_DIR=C:\Work\3rd\zlib114 set PATH=C:\Work\3rd\zlib114\dll32;%PATH% set PATH=C:\Work\3rd\zlib114;%PATH%
cmake -G "Visual Studio 9 2008" ..\3rd\podofo-0.9.1 -DCMAKE_INCLUDE_PATH="%FTDIR%\include;%JPEGDIR%\include;%JPEGDIR%;%ZLIBDIR%\include" -DCMAKE_LIBRARY_PATH="%FTLIBDIR%;%FTDIR%\lib;%JPEGDIR%\lib;%JPEGDIR%;%ZLIBDIR%\lib" -DPODOFO_BUILD_SHARED:BOOL=FALSE -DFREETYPE_LIBRARY_NAMES_DEBUG=freetype239MT_D -DFREETYPE_LIBRARY_NAMES_RELEASE=freetype239MT
компилятор выдает: c:\Work\3rd>del cmakecache.txt Не удается найти c:\Work\3rd\cmakecache.txt
c:\Work\3rd>set FTDIR=C:\Work\3rd\freetype-2.3.9
c:\Work\3rd>set FTLIBDIR=C:\Work\3rd\freetype-2.3.9\objs\win32\vc2008
c:\Work\3rd>set JPEGDIR=C:\Work\3rd\jpeg-8c
c:\Work\3rd>set ZLIB_LIBRARY=C:\Work\3rd\zlib114\dll32\zlib.lib
c:\Work\3rd>set ZLIB_INCLUDE_DIR=C:\Work\3rd\zlib114
c:\Work\3rd>set PATH=C:\Work\3rd\zlib114\dll32;C:\Windows\system32;C:\Windows;C: \Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Fi les\Common Files\Ulead Systems\MPEG;C:\Program Files\Microsoft SQL Server\90\Too ls\binn\;C:\Program Files\CMake 2.8\bin
c:\Work\3rd>set PATH=C:\Work\3rd\zlib114;C:\Work\3rd\zlib114\dll32;C:\Windows\sy stem32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell \v1.0\;c:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Microso ft SQL Server\90\Tools\binn\;C:\Program Files\CMake 2.8\bin
c:\Work\3rd>cmake -G "Visual Studio 9 2008" ..\3rd\podofo-0.9.1 -DCMAKE_INCLUDE_ PATH="C:\Work\3rd\freetype-2.3.9\include;C:\Work\3rd\jpeg-8c\include;C:\Work\3rd \jpeg-8c;\include" -DCMAKE_LIBRARY_PATH="C:\Work\3rd\freetype-2.3.9\objs\win32\v c2008;C:\Work\3rd\freetype-2.3.9\lib;C:\Work\3rd\jpeg-8c\lib;C:\Work\3rd\jpeg-8c ;\lib" -DPODOFO_BUILD_SHARED:BOOL=FALSE -DFREETYPE_LIBRARY_NAMES_DEBUG=freetype2 39MT_D -DFREETYPE_LIBRARY_NAMES_RELEASE=freetype239MT -- Check for working C compiler using: Visual Studio 9 2008 -- Check for working C compiler using: Visual Studio 9 2008 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 9 2008 -- Check for working CXX compiler using: Visual Studio 9 2008 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done WANT_LIB64 unset; assuming normal library directory names Will install libraries to C:/Program Files/PoDoFo/lib -- Looking for strings.h -- Looking for strings.h - not 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 - not found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - not found -- Looking for BaseTsd.h -- Looking for BaseTsd.h - found -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - not found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done -- Using unsigned short -- Check if the system is big endian - little endian -- Found ZLIB: C:/Work/3rd/zlib114/zlib.lib Found zlib headers in C:/Work/3rd/zlib114, library at C:/Work/3rd/zlib114/zlib.l ib -- Found LIBJPEG: C:/Work/3rd/jpeg-8c/libjpeg.lib Found libjpeg headers in C:/Work/3rd/jpeg-8c, library at C:/Work/3rd/jpeg-8c/lib jpeg.lib -- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) Libtiff not found. TIFF support will be disabled CMake Warning (dev) at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPN G.cmake:29 (find_package): File C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPNG.cmake includes C:/Work/3rd/podofo-0.9.1/cmake/modules/FindZLIB.cmake (found via CMAKE_MODULE_PATH) which shadows C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindZLIB.cmake. This may cause errors later on .
Policy CMP0017 is not set: Prefer files from the CMake module directory when including from there. Run "cmake --help-policy CMP0017" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): CMakeLists.txt:332 (FIND_PACKAGE) This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) LibPng not found. PNG support will be disabled -- Ensure you cppunit installed version is at least 1.12.0 Cppunit not found. No unit tests will be built. OpenSSL: Could not find the debug and release version of openssl OpenSSL: Disabling OpenSSL CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHan dleStandardArgs.cmake:91 (MESSAGE): Could NOT find FREETYPE (missing: FREETYPE_LIBRARY) Call Stack (most recent call first): C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardAr gs.cmake:252 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindFREETYPE.cmake:75 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:354 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
c:\Work\ Может подскажите где ошибка?
|