[poppler] Linking Poppler to Code::Blocks
Good Day All, Firstly, I do apologize if this is the incorrect forum in which to ask my questions however, I'm really at my wit's end with this problem and I was hoping one of you could perhaps help me. Basically I wish to write code that will allow me to extract annotations from PDFs. However, I'm yet to write any code as I've spent an inordinate amount of time in just getting Poppler built. These are the steps I've followed so far: {System specs: Windows 7, MinGW, CodeBlocks} 1) I have a folder structure like so: C:\Users\Chris\Documents\Poppler\build\ -poppler-0.22.2 -poppler-0.22.2_Build The file poppler-0.22.2 is the unzipped source files while the poppler-0.22.2_Build file was made by the Cmake GUI with Cairo, JPEG, QT4 and TIFF included. Furthermore, Cmake was instructed to generate a CodeBlocks - MinGW Makefiles. 2) After the CodeBlocks project was generated by Cmake, the project was built in CodeBlocks and I was left with the following: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\ --CMakeFiles --cpp --poppler --qt4 --test --utils --cmake_install.cmake --CMakeCache --config.h --CTestfile.cmake --libpoppler.dll --libpoppler.dll.a --Makefile --poppler.cbp --poppler.layout 3) Now i need to link the poppler library to my project. Therefore in CodeBlocks I did the following: a)Settings-Compiler-Linker settings: Link libraries and I set the path to: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a b)Then in Settings-Compiler-Search directories-Linker I set the path to: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\ c)Then I set up the linking for my project: Project-Build Options-Linker settings and set the path to C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a d)And finally: Project-Build Options-Search directories-Linker and add the path: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\ 4) I have now written the following code in my main.cpp just to see if everything works: 1 : #include iostream 2 : #include C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-global.h 3 : #include C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-document.h 4 : 5 : using namespace std; 6 : 7 : int main() 8 : { 9 : 10: 11: const string dir = C:\\Users\\Chris\\Documents\\WorkForDad\\2013\\Pdf Automation\\Anotation Extraction\\Remuneration Report.pdf; 12: 13:poppler::document *doc = poppler::document::load_from_file(dir); 14: 15:return 0; 16: } However, I get the following error in myBuild messages when I build the code: C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp||In function 'int main()':| C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp|13|warning: unused variable 'doc' [-Wunused-variable]| obj\Debug\main.o||In function `main':| C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp|13|undefined reference to `_imp___ZN7poppler8document14load_from_fileERKSsS2_S2_'| ||=== Build finished: 1 errors, 1 warnings (0 minutes, 1 seconds) ===| ### And in the Build log I get the following: -- Clean: Debug in Clean (compiler: GNU GCC Compiler)--- Cleaned Clean - Debug -- Build: Debug in Clean (compiler: GNU GCC Compiler)--- mingw32-g++.exe -Wall -fexceptions -g -g-c C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp -o obj\Debug\main.o C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp: In function 'int main()': C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp:13:24: warning: unused variable 'doc' [-Wunused-variable] mingw32-g++.exe -L..\..\..\..\..\Poppler\build\poppler-0.22.2_Build -LC:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build -o bin\Debug\Clean.exe obj\Debug\main.o ..\..\..\..\..\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a obj\Debug\main.o: In function `main': C:/Users/Chris/Documents/WorkForDad/2013/Pdf Automation/Test/Clean/main.cpp:13: *undefined reference to `_imp___ZN7poppler8document14load_from_fileERKSsS2_S2_'* collect2.exe: error: ld returned 1 exit status Process terminated with status 1 (0 minutes, 1 seconds) 1 errors, 1 warnings (0 minutes, 1 seconds) ### So as you can see, the problem would seem to be a linking error of some sort due to the
[poppler] Branch 'poppler-0.22' - poppler/SplashOutputDev.cc
poppler/SplashOutputDev.cc |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 53b9cec6c1334020f90b885cff6fc30293437e5f Author: Thomas Freitag thomas.frei...@alfa.de Date: Sun Apr 21 23:28:40 2013 +0200 Splash: Always consider a softmask transfer function Fixes bug 63587 in splash diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 0426b18..6e62720 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -3975,7 +3975,12 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox, for (y = 0; y yMax; ++y) { for (x = 0; x xMax; ++x) { if (alpha) { - p[x] = tBitmap-getAlpha(x, y); + if (transferFunc) { + lum = tBitmap-getAlpha(x, y) / 255.0; + transferFunc-transform(lum, lum2); + p[x] = (int)(lum2 * 255.0 + 0.5); + } else + p[x] = tBitmap-getAlpha(x, y); } else { tBitmap-getPixel(x, y, color); // convert to luminosity ___ poppler mailing list poppler@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/poppler
[poppler] 2 commits - poppler/SplashOutputDev.cc
poppler/SplashOutputDev.cc |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit fd648e83e60db7157b7273ffddc02308b0c5813b Merge: 970e9f6 53b9cec Author: Albert Astals Cid aa...@kde.org Date: Sun Apr 21 23:30:16 2013 +0200 Merge remote-tracking branch 'origin/poppler-0.22' commit 53b9cec6c1334020f90b885cff6fc30293437e5f Author: Thomas Freitag thomas.frei...@alfa.de Date: Sun Apr 21 23:28:40 2013 +0200 Splash: Always consider a softmask transfer function Fixes bug 63587 in splash diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 0426b18..6e62720 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -3975,7 +3975,12 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox, for (y = 0; y yMax; ++y) { for (x = 0; x xMax; ++x) { if (alpha) { - p[x] = tBitmap-getAlpha(x, y); + if (transferFunc) { + lum = tBitmap-getAlpha(x, y) / 255.0; + transferFunc-transform(lum, lum2); + p[x] = (int)(lum2 * 255.0 + 0.5); + } else + p[x] = tBitmap-getAlpha(x, y); } else { tBitmap-getPixel(x, y, color); // convert to luminosity ___ poppler mailing list poppler@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/poppler
Re: [poppler] Linking Poppler to Code::Blocks
On Sat, Apr 20, 2013 at 08:20:42PM +0200, Christopher Icely wrote: Good Day All, Firstly, I do apologize if this is the incorrect forum in which to ask my questions however, I'm really at my wit's end with this problem and I was hoping one of you could perhaps help me. Basically I wish to write code that will allow me to extract annotations from PDFs. However, I'm yet to write any code as I've spent an inordinate amount of time in just getting Poppler built. These are the steps I've followed so far: {System specs: Windows 7, MinGW, CodeBlocks} 1) I have a folder structure like so: C:\Users\Chris\Documents\Poppler\build\ -poppler-0.22.2 -poppler-0.22.2_Build The file poppler-0.22.2 is the unzipped source files while the poppler-0.22.2_Build file was made by the Cmake GUI with Cairo, JPEG, QT4 and TIFF included. Furthermore, Cmake was instructed to generate a CodeBlocks - MinGW Makefiles. 2) After the CodeBlocks project was generated by Cmake, the project was built in CodeBlocks and I was left with the following: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\ --CMakeFiles --cpp --poppler --qt4 --test --utils --cmake_install.cmake --CMakeCache --config.h --CTestfile.cmake --libpoppler.dll --libpoppler.dll.a --Makefile --poppler.cbp --poppler.layout 3) Now i need to link the poppler library to my project. Therefore in CodeBlocks I did the following: a)Settings-Compiler-Linker settings: Link libraries and I set the path to: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a b)Then in Settings-Compiler-Search directories-Linker I set the path to: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\ c)Then I set up the linking for my project: Project-Build Options-Linker settings and set the path to C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a d)And finally: Project-Build Options-Search directories-Linker and add the path: C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\ 4) I have now written the following code in my main.cpp just to see if everything works: 1 : #include iostream 2 : #include C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-global.h 3 : #include C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2\cpp\poppler-document.h 4 : 5 : using namespace std; 6 : 7 : int main() 8 : { 9 : 10: 11: const string dir = C:\\Users\\Chris\\Documents\\WorkForDad\\2013\\Pdf Automation\\Anotation Extraction\\Remuneration Report.pdf; 12: 13:poppler::document *doc = poppler::document::load_from_file(dir); 14: 15:return 0; 16: } However, I get the following error in myBuild messages when I build the code: C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp||In function 'int main()':| C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp|13|warning: unused variable 'doc' [-Wunused-variable]| obj\Debug\main.o||In function `main':| C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp|13|undefined reference to `_imp___ZN7poppler8document14load_from_fileERKSsS2_S2_'| ||=== Build finished: 1 errors, 1 warnings (0 minutes, 1 seconds) ===| ### And in the Build log I get the following: -- Clean: Debug in Clean (compiler: GNU GCC Compiler)--- Cleaned Clean - Debug -- Build: Debug in Clean (compiler: GNU GCC Compiler)--- mingw32-g++.exe -Wall -fexceptions -g -g-c C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp -o obj\Debug\main.o C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp: In function 'int main()': C:\Users\Chris\Documents\WorkForDad\2013\Pdf Automation\Test\Clean\main.cpp:13:24: warning: unused variable 'doc' [-Wunused-variable] mingw32-g++.exe -L..\..\..\..\..\Poppler\build\poppler-0.22.2_Build -LC:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build -o bin\Debug\Clean.exe obj\Debug\main.o ..\..\..\..\..\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a C:\Users\Chris\Documents\Poppler\build\poppler-0.22.2_Build\libpoppler.dll.a obj\Debug\main.o: In function `main': C:/Users/Chris/Documents/WorkForDad/2013/Pdf Automation/Test/Clean/main.cpp:13: *undefined reference to `_imp___ZN7poppler8document14load_from_fileERKSsS2_S2_'* collect2.exe: error: ld returned 1 exit