Giter VIP home page Giter VIP logo

wxpdfview's Introduction

wxPDFView is a set of wxWidgets controls to display and navigate PDF documents using Google Chromes PDFium library.

Screenshot

Resources

Features

Currently implemented:

  • PDF page display control
  • PDF bookmarks control
  • PDF thumbnail control
  • Zooming
  • Search
  • Printing
  • Forms
  • Rotate page view
  • Loading PDF from custom sources (any std::istream)

Currently not implemented:

  • Text selection

Requirements

  • wxWidgets: 3.0.0 or newer
  • PDFium: 2705 (b8180d491e0e38544acbe1b59f949ca4a2701374) or newer

Compiling

It's recommended to use PDFium binaries (Version 4012 or newer) which makes building very easy.

If you dare to build PDFium yourself follow the following instructions:

  • Build PDFium per instructions on the PDFium page.
  • Use GYP_DEFINES='pdf_enable_xfa=0' when building pdfium
  • Use CMake to build the samples/simple project
  • Or use the included CMake file in your project and link wxPDFView lib (will link the required pdfium libs)

Using

Currently includes 3 classes you can include into your own frames

  • wxPDFView Main pdf view
  • wxPDFViewBookmarksCtrl tree control displaying bookmarks contained in the PDF
  • wxPDFViewThumbnailListBox listbox control for displaying thumbnails

Or you can base your PDF viewing on a complete PDF viewer frame

  • wxPDFViewDocumentFrame Combining all controls into a PDF viewer window

After initializing an instance of wxPDFView call wxPDFViewBookmarksCtrl::SetPDFView and/or wxPDFViewThumbnailListBox. Call wxPDFView::LoadFile to load a PDF into the view.

wxpdfview's People

Contributors

rsippl avatar tct2k avatar trogmaniac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wxpdfview's Issues

Direct Printing?

Thanks for taking time to make this library. My question is, can I do direct printing of opened document?
Thanks

cmake doesn't find wxWidgets or pdfium

I can't make cmake find either wxWidgets or pdfium. Which conditions must be met so that cmake finds them?

I already built both wxWidgets and pdfium successfully,

I tried setting the environment variables "PDFIUM_ROOT_DIR" and "wxWidgets_ROOT_DIR", but that didn't change anything.

Please update the readme for newer versions of PDFium as follows

The readme says you need the pdfium binaries version 4012 or later. wxPDFView works fine with the latest versions such as v125.0.6406.0. However if so, then in PDFViewImpl.cpp, comment out this line:

#include "fpdf_libs.h"

(It looks like they removed this header file and the need for it years ago).

And this line:

FPDF_InitEmbeddedLibraries(resPathStr.c_str());

And it will work fine, including with wxWidgets library version 3.2.1.
Perhaps in PDFViewImpl.cpp above these two lines you can add a comment to say that for newer PDFium versions you can just comment them out.
Please? And thank you for this great component!

Make lib on Linux Mint

Hello. After making pdfium lib (see https://forums.wxwidgets.org/viewtopic.php?f=30&t=44130 )
i am truing to compile wxPDFView, but i can not.
With cmake i made makefiles in libs dir, as i explain in link above, and trying make i have problem.
There is an exact way to make lib?
Another question is if i can use source files in a project, and not need to make lib as well.
Thanks
Jim.

compile issue

cmake 3.26 +TDM GCC 9.2+ prebuilt pdfium binaries (version 113.0.5664.0)

compile terminate with following message, is there mistake in souce code?
I didnt find fpdf_libs.h in folder "include " of prebuilt pdfium binaries

[ 7%] Building CXX object CMakeFiles/wxPDFView.dir/src/PDFView.cpp.obj
[ 14%] Building CXX object CMakeFiles/wxPDFView.dir/src/PDFViewImpl.cpp.obj
D:\Coding\lib\wxPDFView\src\PDFViewImpl.cpp:21:10: fatal error: fpdf_libs.h: No such file or directory
21 | #include "fpdf_libs.h"
| ^~~~~~~~~~~~~
compilation terminated.

image

Compile error related to a pdfium header

I tried compiling this project with my own makefile and got most of the cpps compiled except for one, This cpp produces the following errors

//------------------------------------ERRORS------------------------------------------//
g++ -g -Wall -I"C:\DevLibs\wxWidgets\include\wx-3.1" -I"C:\DevLibs\wxWidgets\lib\wx\include\msw-unicode-static-3.1" -I"Include" -I"C:\DevLibs\pdfium-windows-x64-v8\include" -c -o obj/PDFViewImpl.o src/PDFViewImpl.cpp
In file included from C:\DevLibs\pdfium-windows-x64-v8\include/fpdf_dataavail.h:13,
from Include/private/PDFViewImpl.h:20,
from src/PDFViewImpl.cpp:10:
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:803:32: error: variable or field 'FPDF_RenderPage' declared void
803 | FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
| ^~~~~~~~~~~~~~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:803:48: error: 'HDC' was not declared in this scope
803 | FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
| ^~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:804:58: error: expected primary-expression before 'page'
804 | FPDF_PAGE page,
| ^~~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:805:48: error: expected primary-expression before 'int'
805 | int start_x,
| ^~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:806:48: error: expected primary-expression before 'int'
806 | int start_y,
| ^~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:807:48: error: expected primary-expression before 'int'
807 | int size_x,
| ^~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:808:48: error: expected primary-expression before 'int'
808 | int size_y,
| ^~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:809:48: error: expected primary-expression before 'int'
809 | int rotate,
| ^~~
C:\DevLibs\pdfium-windows-x64-v8\include/fpdfview.h:810:48: error: expected primary-expression before 'int'
810 | int flags);
| ^~~
mingw32-make: *** [Makefile:48: obj/PDFViewImpl.o] Error 1
//------------------------------------ERRORS------------------------------------------//

The errors are under the pdfium header fpdfview.h. The pdfium binaries I used are the chromium/4194 version from the pdfium binaries you've linked. Any idea on what to do? happy to give more info on request

Do you have a demo like this but based on MFC?

I think you do a great job, but I would like to know whether you have a demo like this but based on MFC. MFC is short for Microsoft Foundation Classes. I am not good at C++, which means I need a demo to learn something about C++. I expect your help.

Feedback wanted: incoming changes in pdfium-binaries

Hi,

I'm the creator of pdfium-binaries, which host pre-build binaries of PDFium that this project uses.

You probably noticed that the Windows packages are slightly different from the other packages because the import library is not in lib/, but in lib/x86/, lib/x64/ or lib/arm64/. Similarly, the DLL is not in the bin/ but in a subfolder.
I'm currently considering removing this separation so that every package has the same layout, and I'd like to get your feedback before making the change.
I initially made this separation because it allowed me to put x86 and x64 in the same package, but I don't do that anymore, and the subfolders are causing me troubles with CMake where there is no reliable way to detect the target CPU architecture (bblanchon/pdfium-binaries#17).

Please let me know if changing the Windows packages layout is a problem for you and if you think this is going in the right direction or not.

Best regards,
Benoit

Crash with certain PDF file

I found a PDF that leads to a crash somewhere deep in the PDFium code.
http://www.ams.org/notices/200904/tx090400460p.pdf

If it's inside PDFium, there is probably nothing you can do about it, but i'd be interested if it crashes for other people, too or if it could be related to my build

I built PDFium (today's trunk) and wxPDFView with VS2013 under Windows 7/64,

wxPDFView doesn't build with latest pdfium

First, the location and names of some pdfium files have changed. E.g. "fpdfdoc.h" is now "fpdf_doc.h" and lies in /public/. This was something i could fix locally.

But then it creates several compiler errors with are very likely caused by changes in pdfium, which i couldn't fix by myself because they'd require internal knowledge about pdfium.

I hope you'll be able to update wxPDFView to work with the latest pdfium version, i'd really like to use it.

Loading from the Internet

Hi,
does the library support loading PDFs from URL and Auto-Print them?
I have a simple app for receipts and would like to download and print it immediately without user intervention!
TIA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.