Giter Club home page Giter Club logo

qpdf's People

Contributors

archie3d 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  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

qpdf's Issues

js: #document_properties_keywords is undefined.

after build the lib successfully, when i execute the "./pdfwiver", the follows error message will display in the terminal:
Starting ../build-qpdf-Qt5_12_8-Debug/pdfviewer/pdfviewer ...
js: #thumbs is undefined.
js: #thumbs is undefined.
js: #thumbs_label is undefined.
js: #thumbs_label is undefined.
js: #document_outline is undefined.
js: #document_outline is undefined.
js: #document_outline_label is undefined.
js: #document_outline_label is undefined.
js: #attachments is undefined.
js: #attachments is undefined.
js: #attachments_label is undefined.
js: #attachments_label is undefined.
js: #find_input is undefined.
js: #find_input is undefined.
js: #find_previous is undefined.
js: #find_previous is undefined.
js: #find_previous_label is undefined.
js: #find_previous_label is undefined.
js: #find_next is undefined.
js: #find_next is undefined.
js: #find_next_label is undefined.
js: #find_next_label is undefined.
js: #find_highlight is undefined.
js: #find_highlight is undefined.
js: #find_match_case_label is undefined.
js: #find_match_case_label is undefined.
js: #presentation_mode is undefined.
js: #presentation_mode is undefined.
js: #presentation_mode_label is undefined.
js: #presentation_mode_label is undefined.
js: #open_file is undefined.
js: #open_file is undefined.
js: #open_file_label is undefined.
js: #open_file_label is undefined.
js: #print is undefined.
js: #print is undefined.
js: #print_label is undefined.
js: #print_label is undefined.
js: #download is undefined.
js: #download is undefined.
js: #download_label is undefined.
js: #download_label is undefined.
js: #bookmark is undefined.
js: #bookmark is undefined.
js: #bookmark_label is undefined.
js: #bookmark_label is undefined.
js: #first_page is undefined.
js: #first_page is undefined.
js: #first_page_label is undefined.
js: #first_page_label is undefined.
js: #last_page is undefined.
js: #last_page is undefined.
js: #last_page_label is undefined.
js: #last_page_label is undefined.
js: #page_rotate_cw is undefined.
js: #page_rotate_cw is undefined.
js: #page_rotate_cw_label is undefined.
js: #page_rotate_cw_label is undefined.
js: #page_rotate_ccw is undefined.
js: #page_rotate_ccw is undefined.
js: #page_rotate_ccw_label is undefined.
js: #page_rotate_ccw_label is undefined.
js: #cursor_text_select_tool is undefined.
js: #cursor_text_select_tool is undefined.
js: #cursor_text_select_tool_label is undefined.
js: #cursor_text_select_tool_label is undefined.
js: #cursor_hand_tool is undefined.
js: #cursor_hand_tool is undefined.
js: #cursor_hand_tool_label is undefined.
js: #cursor_hand_tool_label is undefined.
js: #scroll_vertical is undefined.
js: #scroll_vertical is undefined.
js: #scroll_vertical_label is undefined.
js: #scroll_vertical_label is undefined.
js: #scroll_horizontal is undefined.
js: #scroll_horizontal is undefined.
js: #scroll_horizontal_label is undefined.
js: #scroll_horizontal_label is undefined.
js: #scroll_wrapped is undefined.
js: #scroll_wrapped is undefined.
js: #scroll_wrapped_label is undefined.
js: #scroll_wrapped_label is undefined.
js: #spread_none is undefined.
js: #spread_none is undefined.
js: #spread_none_label is undefined.
js: #spread_none_label is undefined.
js: #spread_odd is undefined.
js: #spread_odd is undefined.
js: #spread_odd_label is undefined.
js: #spread_odd_label is undefined.
js: #spread_even is undefined.
js: #spread_even is undefined.
js: #spread_even_label is undefined.
js: #spread_even_label is undefined.
js: #document_properties is undefined.
js: #document_properties is undefined.
js: #document_properties_label is undefined.
js: #document_properties_label is undefined.
js: #toggle_sidebar is undefined.
js: #toggle_sidebar is undefined.
js: #toggle_sidebar_label is undefined.
js: #toggle_sidebar_label is undefined.
js: #findbar is undefined.
js: #findbar is undefined.
js: #findbar_label is undefined.
js: #findbar_label is undefined.
js: #previous is undefined.
js: #previous is undefined.
js: #previous_label is undefined.
js: #previous_label is undefined.
js: #next is undefined.
js: #next is undefined.
js: #next_label is undefined.
js: #next_label is undefined.
js: #page is undefined.
js: #page is undefined.
js: #presentation_mode is undefined.
js: #presentation_mode is undefined.
js: #presentation_mode_label is undefined.
js: #presentation_mode_label is undefined.
js: #open_file is undefined.
js: #open_file is undefined.
js: #open_file_label is undefined.
js: #open_file_label is undefined.
js: #print is undefined.
js: #print is undefined.
js: #print_label is undefined.
js: #print_label is undefined.
js: #download is undefined.
js: #download is undefined.
js: #download_label is undefined.
js: #download_label is undefined.
js: #bookmark is undefined.
js: #bookmark is undefined.
js: #bookmark_label is undefined.
js: #bookmark_label is undefined.
js: #tools is undefined.
js: #tools is undefined.
js: #tools_label is undefined.
js: #tools_label is undefined.
js: #zoom_out is undefined.
js: #zoom_out is undefined.
js: #zoom_out_label is undefined.
js: #zoom_out_label is undefined.
js: #zoom_in is undefined.
js: #zoom_in is undefined.
js: #zoom_in_label is undefined.
js: #zoom_in_label is undefined.
js: #zoom is undefined.
js: #zoom is undefined.
js: #page_scale_auto is undefined.
js: #page_scale_auto is undefined.
js: #page_scale_actual is undefined.
js: #page_scale_actual is undefined.
js: #page_scale_fit is undefined.
js: #page_scale_fit is undefined.
js: #page_scale_width is undefined.
js: #page_scale_width is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #page_scale_percent is undefined.
js: #first_page is undefined.
js: #first_page is undefined.
js: #last_page is undefined.
js: #last_page is undefined.
js: #page_rotate_cw is undefined.
js: #page_rotate_cw is undefined.
js: #page_rotate_ccw is undefined.
js: #page_rotate_ccw is undefined.
js: #error_more_info is undefined.
js: #error_more_info is undefined.
js: #error_less_info is undefined.
js: #error_less_info is undefined.
js: #error_close is undefined.
js: #error_close is undefined.
js: #password_label is undefined.
js: #password_label is undefined.
js: #password_cancel is undefined.
js: #password_cancel is undefined.
js: #password_ok is undefined.
js: #password_ok is undefined.
js: #document_properties_file_name is undefined.
js: #document_properties_file_name is undefined.
js: #document_properties_file_size is undefined.
js: #document_properties_file_size is undefined.
js: #document_properties_title is undefined.
js: #document_properties_title is undefined.
js: #document_properties_author is undefined.
js: #document_properties_author is undefined.
js: #document_properties_subject is undefined.
js: #document_properties_subject is undefined.
js: #document_properties_keywords is undefined.
js: #document_properties_keywords is undefined.
js: #document_properties_creation_date is undefined.
js: #document_properties_creation_date is undefined.
js: #document_properties_modification_date is undefined.
js: #document_properties_modification_date is undefined.
js: #document_properties_creator is undefined.
js: #document_properties_creator is undefined.
js: #document_properties_producer is undefined.
js: #document_properties_producer is undefined.
js: #document_properties_version is undefined.
js: #document_properties_version is undefined.
js: #document_properties_page_count is undefined.
js: #document_properties_page_count is undefined.
js: #document_properties_page_size is undefined.
js: #document_properties_page_size is undefined.
js: #document_properties_close is undefined.
js: #document_properties_close is undefined.
js: #print_progress_message is undefined.
js: #print_progress_message is undefined.
js: #print_progress_percent is undefined.
js: #print_progress_percent is undefined.
js: #print_progress_close is undefined.
js: #print_progress_close is undefined.
js: #of_pages is undefined.
js: #page_scale_percent is undefined.

My question is how to avoid this error message?
Thanks!

QWidget: Must construct a QApplication before a QWidget

Hello, I use qpdf in my application since some months ago. Everything worked fine but I'd like to switch my application from x86 to x64.

If I build the qpdf library with Qt_5_12_7_MSVC2017_64bit-Debug kit:
-> My application works fine in debug mode; I'm able to load pdf file
-> My application doesn't work in release mode; I get this error: QWidget: Must construct a QApplication before a QWidget
release

If I build the qpdf library with Qt_5_12_7_MSVC2017_64bit-Realease kit:
-> My application doesn't work in debug mode; I'm not able to load pdf and I get this error:
Resource :/pdfview/pdf.js not found or is empty
Resource :/pdfview/viewer.js not found or is empty
Uncaught ReferenceError: qpdf_Initialize is not defined

-> My application doesn't work in release mode; I'm not able to load pdf and I get this error:
Resource :/pdfview/pdf.js not found or is empty
Resource :/pdfview/viewer.js not found or is empty
Uncaught ReferenceError: qpdf_Initialize is not defined

As you can see it works in debug mode when the library is built in debug mode too.
But I'd like to build my application in release mode.
Do you have any idea from where the problem could come from? Thanks a lot for your help.

License?

Hi,

I would like to know under which license do you release this small piece of code, please?

Thanks,
Arnaud

include linux support

please add support for linux.

i added this lib in my app for linux. it builds and runs fine.
but when i packaged it and install it in system it does not found by my app.

because there is no path to put it in linux syatem .
and it is conflicts with another library named same qpdf.
i think if you change the name to be different library.
here is my app GITHUB

[Feature Request] add some feature

i have some feature request.

  1. add a option to turn off the hyper-link form qpdfwidget .
  2. get a pdf page as a pixmap (picture) .
  3. and add a close method in example app.
  4. get the pdf properties in text (qtextbrowser).
  5. add version naming .
  6. disable the print button as it's not able to do anything.
  7. and add option to select the zoom value in startup.

i hope this feature is relevant to qpdf and get this in next release.

Using the viewer example

How can i run your viewer example?
I open the .pro on qt creatorn and i build the project with this error:
"cannot find -lqpdf"

error:setWebChannel

pdfjsbridge.cpp(133): error C2039: “setWebChannel”: 不是“QWebEnginePage”的成员

Parallel build broken

When a parallel build is done (e.g. make -j 10) the build will fail because pdfviewer will try to use -lqpdf before that is built.

Scrolling/Zooming issues

I used a slightly modified version of the pdfviewer example with a red background so I can easily see the exact dimension of the QPdfWidget instance, otherwise it is the exact code from the repository.

Initially a PDF is shown 20171005_143537
on a device with touchscreen, and everything compiled with Qt 5.9.1. Then I used a pinch gesture to shrink the PDF contents. However the area of the rendering shrinked with it I would have expected it to still use the full height of the QPdfWidget, showing more than the initial half page.
20171005_143552

If I then use a scroll gesture it depends on the location of the gesture inside the QPdfWidget which behavior I get:

  • scrolling on the right side (grey area) of the widget moves the draw area as seen in the example, I moved up the PDF drawing by half the size
    20171005_143641

  • scrolling on the draw area actually moves the contents of the PDF as I would have expected for the other action, too

Error on using qpdf.lib on vs 2019

I build on qtcreator and vs 2019.

When I want to use of qpdf.lib like example, I get this error on build (debugx64):

error C2491: 'QPdfWidget::staticMetaObject': definition of dllimport static data member not allowed

help on a sample project.

i am in linux. qt5.10.1.
i tried to make a sample project with qpdf lib with designer(not with code)
made new ui/cpp/h .added a layout and added this lines in conostrector .

`
m_pPdfWidget = new QPdfWidget();
ui->layout->addWidget(m_pPdfWidget);
QString filePath = QString::fromLatin1("/home/shaber/Desktop/c.pdf");
m_pPdfWidget->loadFile(filePath);

`
pdf widget shows just fine.but the given pdf is not showing.
opening pdf with the folder icon within the pdfwidget working fine.

o

here is the application output.

[0509/175601.963406:WARNING:stack_trace_posix.cc(648)] Failed to open file: /home/shaber/#272223 (deleted) Error: No such file or directory qt5ct: using qt5ct plugin QMetaObject::connectSlotsByName: No matching signal for on_open_clicked() js: The provided value 'moz-chunked-arraybuffer' is not a valid enum value of type XMLHttpRequestResponseType. js: Failed to load file:///home/shaber/Desktop/c.pdf: Cross origin requests are only supported for protocol schemes: http, data, chrome, https. js: Uncaught TypeError: Cannot read property 'onProgressiveData' of undefined js: Uncaught TypeError: Cannot read property 'reject' of undefined

i think i need to add the code in main.cpp that you added in your one .but i don't want any command line support.
so how i solve this problem.
please help me.

Qtreeview for bookmark

This works well.
But what if i dot want to use bookmark by pdf.js and rather i want list of bookmark from pdf.js and want to show in qtreeview. How can that be possible?

not getting the document properties and destination

i am trying to get the pdf file properties . as the properties window is showing with out loading the file so properties window only a blank window . also the i am not getting the file destination with the "getDestinations" function .

is there a separate function to get know the file is loaded ?? if there i need to check if the file is loaded the request for the properties and destination.

` void corepdf::openPdfFile(const QString path)
{
QVBoxLayout * mainLayout = new QVBoxLayout();
PdfWidget = new QPdfWidget();

connect(PdfWidget, &QPdfWidget::initialized, [this,path]() {
    PdfWidget->setToolbarVisible(true);
    PdfWidget->showDocumentProperties();
    qDebug() << PdfWidget->getDestinations();
    QFile f(path);
    if (f.open(QIODevice::ReadOnly)) {
        QByteArray data = f.readAll();
        PdfWidget->loadData(data);
        f.close();

    }
});

mainLayout->setContentsMargins(0,0,0,0);
mainLayout->addWidget(PdfWidget);
setLayout(mainLayout);

}`

here is the output

q

thanks

[Feature Request] add this functions

i am requesting for this features.

  1. I want to get the pdf document properties in a qstring so i can use it other way .so a function for getting the all the properties in qstring.
  2. A function to get a page thumbnail in a Qlabel. i need this feature badly.
  3. Is there a separate function to get know the file is loaded ?? if not , please implement one.

i am very much fond of your work and thanks for updating the pdf.js to v2.

Error displaying PDF - White font

Hi.

I have a problem displaying some PDFs. The font has the same color to backgroud (white). I tried to fix it changing some parameters in viewer.css file but the maximun contrast than I could obtain was this

image

How can I fix it?

Thanks

An error occurred while loading the PDF

I'm running the project with win7, 32bits, Qt5.6.0 msvc.
It could run successful, but it could not open any PDF and show massage like this
image

May I ask how can I open some PDF files.
Thank you very much.

Request for as a library

I want to use the qpdf as a library of my app .
But qpdf is an app and it come with app and the library.
so i need to add the whole repo and it will come with the app .but it is not convenient to make an app with two front end and with one library.One only need the library to make an app based on the qpdf.
And i want my app in GPL but the license make it impossible to make my app in GPL and library in LGPL.

Also add Linux and windows installation requirements in qmake .i don't know about windows ,here is an example of mac and linux qmake .here is the library libarchive-qt

``
unix {
isEmpty(PREFIX) {
PREFIX = /usr
}

INSTALLS	+= target includes data
CONFIG		+= create_pc no_install_prl link_pkgconfig
contains(DEFINES, LIB64): target.path = $$INSTALL_PREFIX/lib64
else: target.path = $$INSTALL_PREFIX/lib

target.path			= $$PREFIX/lib/
includes.files		= libarchiveqt.h
includes.path		= $$PREFIX/include/

data.path = $$PREFIX/share/lib$$TARGET/
data.files = Changelog README

QMAKE_PKGCONFIG_NAME = libarchive-qt
QMAKE_PKGCONFIG_DESCRIPTION = A Qt based archiving solution with libarchive backend
QMAKE_PKGCONFIG_PREFIX  = $$INSTALL_PREFIX
QMAKE_PKGCONFIG_LIBDIR  = $$target.path
QMAKE_PKGCONFIG_INCDIR  = $$includes.path
QMAKE_PKGCONFIG_VERSION = $$VERSION
QMAKE_PKGCONFIG_DESTDIR = pkgconfig

}

macx {
INCLUDEPATH += /usr/local/opt/libarchive/include /usr/local/opt/xz/include
QMAKE_LFLAGS += -L/usr/local/opt/libarchive/lib -L/usr/local/opt/xz/lib
}

``

so i am suggesting that make an option in qmake to build the library with the app or make a separate repo for only the library . it will be best .

Reproduce Video which is inside a PDF file

Hello,

is it possible to display PDFs which has inside them a video? Y see the video in the PDF file, but the play button does not work. In Abode Reader works.

Thanks you very much.

Now it only render default file pdf

I found that QPdfWidget::renderPdf() call to unknow javascript function "showPDFFile" then the application will show a default file ?
Which method i can use to show a specific PDF file ?
Tks.

How to Deploy ?

I've had success using it within QT Creator, both in DEBUG and RELEASE.

But when trying to DEPLOY, that is, using it outside the QT environment, my program run ok, but when it calls to show the PDF, the program gives a CRASH.

Where should the RESOURCES be placed, along with the .EXE or in another directory?

close opened pdf properly

how can i close the opened pdf??

in my app i added the qdfwidget .
when i close the qdfwidget , it crashes the whole app .
i think i need to close the qdfwidget properly.

i tried
` void corepdf::eclose(){
QPdfWidget cpdf = this->findChild<QPdfWidget>("QPdfWidget");
cpdf->close();
}

`

.but qdfwidget not closing .

how can i close qdfwidget properly??

Error loading/displaying some PDF.

I tried to load a pdf file and I'm running into this error:

js: Uncaught (in promise) TypeError: Cannot read property 'classList' of null
[1:2:0126/013732.141117:ERROR:channel.cc(507)] Invalid message size: 378616088

Your pdfviewer stays completely grey. It is displayed normally into Firefox 58.0.

Release build does not work.

When i compile the project via the qt creator using debug mode everything works fine.
But when i change to release i get the following error:

js: Uncaught ReferenceError: qpdf_Initialize is not defined

Any idea why that might happen. Thanks in advance.

licensing issue

the problem is i will include this corepdf in my app CoreBox.
for this i need one qmake for my main app that could include all the cpp and header file including corepad's library.

so my consernt is that if i include the library in the same qmake , is there any problem??
like this
`
TEMPLATE = app

CONFIG += c++11

QT += widgets
webengine
webenginecore
webenginewidgets
webchannel

HEADERS += corepdf.h
qpdflib/pdfjsbridge.h
qpdflib/qpdf.h
qpdflib/qpdfwidget.h \

SOURCES +=
corepdf.cpp
main.cpp
qpdflib/pdfjsbridge.cpp
qpdflib/qpdfwidget.cpp \

RESOURCES +=
qpdflib/pdfview.qrc
`

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.