How i can take a pdf page as image in wxDc?

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Tue Dec 19, 2017 4:09 pm

I see it, thank's but have only signature, not code.
By the way 'out/debug/pdfium_test --png /home/a/mozilla.pdf' runs ok and produce images.
So i must find the pdfium_test code to see how it works.

But i am emotionally connect with wxWidgets framework for all this job have done, so i'd like to use wxPDFView in my project.

BTW *buildtools is the folder that gn.py uses for making args.gn file (gn args out/debug) in out/debug dir.
If we clone from github there is not this folder. So we must use instructions as above exactly and download from google-git. I write those things to remember and for anyone that will help.

Thank's again.
Jim

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: How i can take a pdf page as image in wxDc?

Postby eranon » Tue Dec 19, 2017 6:58 pm

[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Tue Dec 19, 2017 7:07 pm

Oh, thank's, i have study ... ok, very well :) .
Before of that i will try to make the wxPDFView lib, for study.
I'd like to learn new things, it is very pleasant.
Now i have all libs in obj dir, and all in out/debug dir of PDFium.
What command must give to terminato to make the lib?
Just cmake?
As i see libs that want FindPDFium.cmake are
fpdfapi, fpdfdoc,fpdftext,fxcodec,fxcrt,fxedit,fxge
fx_agg,fx_freetype,fx_lcms2,libjpeg,fx_libopenjpeg,fx_lpng,fx_zlib,icui18n,icuuc,javascript, pdfium,pdfwindow, v8_libbase, v8_libplatform, v8_snapshot.

PDFium libs are
drm.a, formfiller.a, fpdfapi.a,fpdfdoc.a,fpdftext.a,fxcodec.a,fxcrt.a,fxge.a,fxjs.a, image_diff.a, pdfium.a,pwl.a,test_support.a

How i made lib?
Jim

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: How i can take a pdf page as image in wxDc?

Postby eranon » Tue Dec 19, 2017 7:53 pm

I don't know Ninja, so I can't help, but reading this https://github.com/pvginkel/PdfiumViewe ... ing-PDFium and this https://stackoverflow.com/questions/296 ... pplication I think it should be built at the step you are... And after this, you have to link it with your own project (eg. as did this guy there: https://stackoverflow.com/questions/296 ... pplication).

If your project is using CMake, this could be of some help: https://groups.google.com/forum/#!topic ... C-VO8ieaaU

But, frankly for the PDFium specificities, you should be better to join https://groups.google.com/forum/#!forum/pdfium and be back here for the wxWidgets related topics...
Last edited by eranon on Tue Dec 19, 2017 9:26 pm, edited 1 time in total.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Tue Dec 19, 2017 9:20 pm

Ok tomorrow i will study. :)
Thank's
Jim

User avatar
doublemax
Moderator
Moderator
Posts: 12603
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How i can take a pdf page as image in wxDc?

Postby doublemax » Tue Dec 19, 2017 9:26 pm

I played around with wxPDFView under Windows about a year ago. I just looked into the sample project and it links all the different pdfium libraries individually.
Use the source, Luke!

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Wed Dec 20, 2017 9:41 am

In sample can i insert all .h and .cpp files from wxPDFView like i did with wxPDFDocument?
To do not make lib but only insert sources?
Add if yes, must some source not be insert to project?
For example dirs bellow must inser .h and .cpp files?
wxPDFView/art/
wxPDFView/include/private/

Thank's
Jim.

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Wed Dec 20, 2017 1:35 pm

Running cmake-gui i have problem to make lib. I have red letters.
I upload a picture, what i have wrong? At CBUILD TYPE what i must put?
Thanks
Jim.
Attachments
CMake 2.8.12.2 - -home-a-wxPDFView-libs_077.png

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Wed Dec 20, 2017 2:28 pm

Ok red letters are for developers. So with options>'Suppress dev warnings' red letters disappear.
Truin to Configure, ok, and the Generate, ok.
Then in terminal with make i have problems.
First of all "/home/a/wxPDFView/include/private/PDFViewBookmarks.h" the #include "fpdfdoc/fpdf_doc.h" does not exist in home/a/repo/PDFium/..., only #include "fpdf_doc.h" at "include/private/PDFViewBookmarks.h".

Making comment the line...

Code: Select all

#ifndef PDFVIEW_BOOKMARKS_H
#define PDFVIEW_BOOKMARKS_H

#include "PDFView.h"
#include "fpdf_doc.h"
//#include "fpdfdoc/fpdf_doc.h"

class wxPDFViewBookmarks
{
public:
   wxPDFViewBookmarks(FPDF_DOCUMENT doc);

   const wxPDFViewBookmark* GetRoot() const { return m_root.get(); };

private:
   CPDF_BookmarkTree m_tree;
   wxSharedPtr<wxPDFViewBookmark> m_root;
};


That's ok, but with make compiler says ...

a@a-desktop ~/wxPDFView/libs $ make
[ 7%] Building CXX object CMakeFiles/wxPDFView.dir/src/PDFView.cpp.o
In file included from /home/a/wxPDFView/include/private/PDFViewImpl.h:27:0,
from /home/a/wxPDFView/src/PDFView.cpp:11:
/home/a/wxPDFView/include/private/PDFViewBookmarks.h:25:2: error: ‘CPDF_BookmarkTree’ does not name a type
CPDF_BookmarkTree m_tree;
^
make[2]: *** [CMakeFiles/wxPDFView.dir/src/PDFView.cpp.o] Error 1
make[1]: *** [CMakeFiles/wxPDFView.dir/all] Error 2
make: *** [all] Error 2


Any advice?

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: How i can take a pdf page as image in wxDc?

Postby eranon » Wed Dec 20, 2017 4:28 pm

There are chances that CPDF_BookmarkTree belongs to PDFium. So, your project have to be able to reach the PDFium headers.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Wed Dec 20, 2017 5:09 pm

Ok i know that.
But how to write the make command to "/home/a/wxPDFView/libs" dir where are all files?
I have never done again something like, i just study all that.

/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CompilerIdC/a.out
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CompilerIdCXX/a.out
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/build.make
/home/a/wxPDFView/libs/CMakeFiles/cmake.check_cache
/home/a/wxPDFView/libs/CMakeCache.txt
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/cmake_clean.cmake
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/cmake_clean_target.cmake
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_CXX.bin
/home/a/wxPDFView/libs/CMakeFiles/CMakeDirectoryInformation.cmake
/home/a/wxPDFView/libs/cmake_install.cmake
/home/a/wxPDFView/libs/CMakeFiles/CMakeOutput.log
/home/a/wxPDFView/libs/CMakeFiles/2.8.12.2/CMakeSystem.cmake
/home/a/wxPDFView/libs/CMakeFiles/Progress/count.txt
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/CXX.includecache
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/depend.internal
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/depend.make
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/DependInfo.cmake
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/flags.make
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/link.txt
/home/a/wxPDFView/libs/CMakeFiles/Makefile.cmake
/home/a/wxPDFView/libs/CMakeFiles/wxPDFView.dir/progress.make
/home/a/wxPDFView/libs/CMakeFiles/progress.marks
/home/a/wxPDFView/libs/CMakeFiles/TargetDirectories.txt
Attachments
CMake 2.8.12.2 - -home-a-wxPDFView-libs_078.png
CMake 2.8.12.2 - -home-a-wxPDFView-libs_078.png (76.55 KiB) Viewed 787 times

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: How i can take a pdf page as image in wxDc?

Postby eranon » Wed Dec 20, 2017 5:50 pm

On https://github.com/TcT2k/wxPDFView, I read:

Use the included CMake file in your project and link wxPDFView lib (will link the required pdfium libs)

Or contact the author for detail (it's always the same: better to ask to the right person, dkaip).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: How i can take a pdf page as image in wxDc?

Postby dkaip » Wed Dec 20, 2017 7:01 pm

Thanks eragon, but cmake-gui already has wxPDFView.cmake file and generation is ok.
Now i must see how to construct lib. As i see none use linux for construct libs.
I wiil try myself.

Jim.


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 0 guests