wxPDFView from sources

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

wxPDFView from sources

Post by dkaip »

Hello.
I have build the wxPDFView from sources with CodeBlocks, GCC, Linux Mint, and connect with pdfium(libpdfium.so 28.1MB)
But when i open a pdf file gives icons in mouse rotation like that and i don’t know the reason. The simple program is very simple.
Thank you
Jim
Attachments
164.png
164.png (4.33 KiB) Viewed 11252 times
165.png
166.png
166.png (77.78 KiB) Viewed 11252 times
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

Re: wxPDFView from sources

Post by dkaip »

Also at another GUI test opening a simple pdf control says ...

Code: Select all

void wxPDFView_testDialog::OnAbout(wxCommandEvent &event)
{
	wxFileDialog dlg(this, "Select Document", wxEmptyString, wxEmptyString, "*.pdf", wxCENTRE|wxFD_OPEN|wxFD_FILE_MUST_EXIST);
	if (dlg.ShowModal() == wxID_OK)
	{
		wxPDFViewDocumentFrame* frame = new wxPDFViewDocumentFrame(this);

		if (frame->LoadFile(dlg.GetPath()))
			frame->Show();
	}
}
Why is that?
Thank you
Jim
Attachments
001.png
001.png (19.68 KiB) Viewed 11250 times
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxPDFView from sources

Post by doublemax »

That means you didn't call ::wxInitAllImageHandlers(). Do that once, e.g. in your wxApp::OnInit()
Use the source, Luke!
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

Re: wxPDFView from sources

Post by dkaip »

Thank you, it opens pdfs, 001.png disappear ...
But the control do not displays the pdf pages except the first one.
Have the simple sample of wxPDFView problem?

I am punting the sample.

Thank you
Jim

Code: Select all

/////////////////////////////////////////////////////////////////////////////
// Name:        samples/simple/Simple.h
// Purpose:     Simple sample app
// Author:      Tobias Taschner
// Created:     2014-08-07
// Copyright:   (c) 2014 Tobias Taschner
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _SIMPLE_H_
#define _SIMPLE_H_

#include <wx/app.h>
#include <wx/frame.h>

class SimpleApp : public wxApp
{
public:
	virtual bool OnInit();
};

class SimpleFrame : public wxFrame
{
public:
	SimpleFrame();
	void OnButton(wxCommandEvent &evt);
};

wxIMPLEMENT_APP(SimpleApp);

#endif

Code: Select all

/////////////////////////////////////////////////////////////////////////////
// Name:        samples/simple/Simple.h
// Purpose:     Simple sample app implementation
// Author:      Tobias Taschner
// Created:     2014-08-07
// Copyright:   (c) 2014 Tobias Taschner
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#include <wx/menu.h>
#include <wx/msgdlg.h>
#include <wx/sharedptr.h>
#include <wx/webview.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/filedlg.h>

#include "Simple.h"

#include "PDFViewDocumentFrame.h"

bool SimpleApp::OnInit()
{
    wxInitAllImageHandlers();
    wxImage::AddHandler(new wxPNGHandler());

    SimpleFrame *frame = new SimpleFrame();
    frame->Show(true);

    return true;
}

SimpleFrame::SimpleFrame() : wxFrame(NULL, wxID_ANY, "wxPDFView")
{
    wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);

    wxButton* btn = new wxButton(this, wxID_ANY, "Load document");

    topsizer->Add(btn, 0, wxCENTER);

    this->SetSizer(topsizer);
    this->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SimpleFrame::OnButton, this);
}

void SimpleFrame::OnButton(wxCommandEvent &evt)
{
    wxFileDialog dlg(this, "Select Document", wxEmptyString, wxEmptyString, "*.pdf", wxCENTRE|wxFD_OPEN|wxFD_FILE_MUST_EXIST);
    if (dlg.ShowModal() == wxID_OK)
    {
        wxPDFViewDocumentFrame* frame = new wxPDFViewDocumentFrame(this);

        if (frame->LoadFile(dlg.GetPath()))
            frame->Show();
    }
}
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxPDFView from sources

Post by doublemax »

Have the simple sample of wxPDFView problem?
Unlikely. I only build wxPDFView once a few years ago and it seemed to work fine. But building it is such a hazzle, that i don't feel like doing it again :)
Use the source, Luke!
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

Re: wxPDFView from sources

Post by dkaip »

I have build wxPDFView.a on windows 10 with cmake and MinW64 and codeblocks, and after that i never managed to work.
Of course most people works with MSVS as i understud, and that is more easy.
The basic reason that i use only Codeblocks and MinGW are the wxWidgets framework, the open source and the possibility in the future to be the most complete system, as possibilities are constantly added, has greater simplicity in its database, so that from a copywriter you can make operations.
I am trying to find out all that on windows, because in linux all working fine.
Thank you
Jim
ollydbg23
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

Re: wxPDFView from sources

Post by ollydbg23 »

dkaip wrote: Fri Nov 13, 2020 4:05 pm I have build wxPDFView.a on windows 10 with cmake and MinW64 and codeblocks, and after that i never managed to work.
Can you share us how you did that?

I have see a similar discussion:
update pdfium-git / git fetch fails · Issue #6284 · msys2/MINGW-packages

the pdfium-git library is hard to build under msys2/MinGW64.

Thanks.
Post Reply