Giter VIP home page Giter VIP logo

wkhtmltopdf / qt Goto Github PK

View Code? Open in Web Editor NEW
42.0 42.0 106.0 429.72 MB

forked Qt 4.8 with wkhtmltopdf-specific patches

License: Other

Shell 0.10% Perl 0.14% C 2.74% Makefile 0.01% Prolog 0.01% Objective-C++ 1.28% C++ 86.27% JavaScript 0.97% Scilab 0.01% XSLT 0.11% Python 0.10% XQuery 0.01% CSS 0.05% Assembly 0.06% Objective-C 0.08% GAP 0.33% Batchfile 0.01% QMake 0.55% HTML 4.04% QML 3.14%

qt's Introduction

wkhtmltopdf and wkhtmltoimage

wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine. These run entirely "headless" and do not require a display or display service.

See https://wkhtmltopdf.org for updated documentation.

Building

wkhtmltopdf has its own dedicated repository for building and packaging.

See https://github.com/wkhtmltopdf/packaging

qt's People

Contributors

adereis avatar ashkulz avatar biochimia avatar bjorn avatar dfaure avatar drdanz avatar fid-jose avatar jpnurmi avatar jrbarron avatar jturcotte avatar konstantinritt avatar krh avatar mabrand avatar miniak avatar mstorsjo avatar net147 avatar nierob avatar ogoffart avatar ossilator avatar phartmann avatar rakuco avatar rburchell avatar stasuku avatar thiagomacieira avatar thomashartmannqt avatar tmcguire avatar tokoe avatar torarnv avatar yinyunqiao avatar zecke 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt's Issues

Build failure on IBM Z (s390x)

Building wkhtmltopdf with the patched qt on IBM Z (s390x) failed with ld complaining about a missing symbol in qt. Turns out that the implementation of fetchAndAddOrdered is missing in qatomic_s390.h.

Please consider picking up that patch:
https://bugreports.qt.io/browse/QTBUG-23257

With that patch the build was successful. I did run some tests with the resulting wkhtmltopdf binary and it all looked good to me.

Segmentation Fault on blockquotes tag if css specified

@optyler commented on Fri Oct 05 2018

Hi,

we just found a segmentation error while converting a local html which contains a blockquote tag AND with a quotes css property defined on it.

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
    <title>Test</title>
    <style>
      blockquote {
        quotes: none;
      }
    </style>
 </head>

 <body>
   <blockquote>tests</blockquote>
 </body>
<html>
wkhtmltopdf --log-level info index.html index.pdf
Loading pages (1/6)
Erreur de segmentation=========>                             ] 50%

If I remove the quotes: none; property, the conversion works fine.

$> wkhtmltopdf --version
wkhtmltopdf 0.12.5 (with patched qt)

$> cat /etc/*releas*
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian

qt_defaultDpi() issue

Could someone explain, what it was? git push --force?
qt_defaultdpi
I've removed repo and cloned again. Looks fine now.

[PATCH] fix for "HTML Input text controls doesn't print the value in PDF"

This little patch fixes:
wkhtmltopdf/wkhtmltopdf#2004
wkhtmltopdf/wkhtmltopdf#2005

There's also a typo "Parrent" vs "Parent" but I don't know if that affects anything ;)

diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index 4988df1..e668fcf 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -278,9 +278,17 @@ void QPdfEngine::addTextField(const QRectF &r, const QString &text, const QStrin
     char buf[256];
     QRectF rr = d->pageMatrix().mapRect(r);
     if (d->formFieldList == -1) d->formFieldList = d->requestObject();
+    /*
+     * http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf
+     *
+     * 12.5.3 Annotation Flags - bit 3:
+     * (PDF 1.2) If set, print the annotation when the page is printed. If clear,
+     * never print the annotation, regardless of whether it is displayed on the screen.
+     */
     d->xprintf("<<\n"
                "/Type /Annot\n"
-               "/Parrent %d 0 R\n"
+               "/F 4\n" // printable flag
+               "/Parent %d 0 R\n"
                "/Rect[", d->formFieldList);
     d->xprintf("%s ", qt_real_to_string(rr.left(),buf));
     d->xprintf("%s ", qt_real_to_string(rr.top(),buf));

Instructions aren't current with Qt's online docs and source code

I'm trying to follow instructions to install your patched Qt. Finally, I got the separate qt repo into the wkhtmltopdf repo (I probably should have made it a git submodule, but haven't yet). Then I tried:

./build package-docker buster-amd64 ../wkhtmltopdf

and got:

Error: remote trust data does not exist for docker.io/aptman/qus: notary.docker.io does not have trust data for docker.io/aptman/qus
docker pull --platform linux/amd64 aptman/qus:d5.0
command failed: exit code 1

I do not know much about docker and would appreciate knowing how to proceed.

For many years I have enjoyed using wkhtmltopdf on Linux via a screen grab, but being able to script it on a remote host would be wonderful!

Note I am a long-time Perl (since 1993) and now Raku user (since 2015), but I've also had to create or maintain Fortran, C, and C++ libraries for necessary jobs at $work. But it's been over 15 years since I've had to compile Qt and it was NEVER any fun.

Need qt patch for Toc support

i have convert table of content web page to pdf using wkhtmltopdf wrapper with own builded qt source in windows 8.1 in output pdf file internal and external links are not enbled due to that page navigation does not work .and used toc option ( wkhtmltopdf toc Toc.html toctest.pdf) in command i am getting warning "This version of wkhtmltopdf is build against an unpatched version of QT "
my input html file

`

<title>Auto Outlines and Links</title>

Contents

Go To Chapter 1
Go To Chapter 2
Go To Chapter 3
Visit Website

Chapter 1

This is the chapter 1 content.

Chapter 2

This is the chapter 2 content.

Chapter 3

This is the chapter 3 content. `

Homebrew fatal error: branch wk_4.8.6 not found...

I was trying to follow the first instruction on http://natepinchot.com/2014/01/31/building-static-wkhtmltopdf/ for OS X and Homebrew, which is...

brew install https://raw.github.com/npinchot/homebrew/wkhtmltopdf_static_qt/Library/Formula/qt-wkhtmltopdf.rb

I got the following output...

==> Cloning https://github.com/wkhtmltopdf/qt.git
Cloning into '/Library/Caches/Homebrew/qt-wkhtmltopdf--git'...
warning: Could not find remote branch wk_4.8.6 to clone.
fatal: Remote branch wk_4.8.6 not found in upstream origin
Unexpected end of command stream
Error: Failed to download resource "qt-wkhtmltopdf"
Failure while executing: git clone --depth 1 --branch wk_4.8.6 https://github.com/wkhtmltopdf/qt.git /Library/Caches/Homebrew/qt-wkhtmltopdf--git

Looking here, I see that there is a 4.8.5 branch, but not 4.8.6. Is there a problem that needs to be fixed for this to work? Alternatively, is there a different set of instructions that I should be following to install wkhtmltopdf with static QT via Homebrew?

Need to partially convert HTML to PDF document

Hi All,

i am using qtwebkit 5.5 for convert HTML to PDF in that i want to partially convert HTML page to PDF by specifying HTML elements (div,Table,chart,image etc) instead of convert hole page for example i am having HTML page with more then one

content from that i want to convert any one of the div content as PDF by specifying its ID . please share your views .

Thanks in advance.

make[1]: *** [Makefile:2578: .obj/debug-shared/qvariableloader.o] Error 1

Actually i try to build wkhtmltopdf-qt for openSUSE. The build breaks there:

[ 346s] g++ -c -m64 -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_XMLPATTERNS_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include -I../../include/QtXmlPatterns -I.rcc/debug-shared -Iacceltree -Idata -Iapi -Ienvironment -Iexpr -Ifunctions -Iiterators -Ijanitors -Iparser -Ischema -Itype -Iutils -I.moc/debug-shared -o .obj/debug-shared/qabstracturiresolver.o api/qabstracturiresolver.cpp
[ 346s] In file included from api/qcoloringmessagehandler_p.h:57:0,
[ 346s] from api/qxmlquery_p.h:67,
[ 346s] from api/qvariableloader.cpp:54:
[ 346s] api/qcoloroutput_p.h:74:60: warning: result of '(1048575 << 20)' requires 41 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
[ 346s] BackgroundMask = ((1 << BackgroundShift) - 1) << BackgroundShift
[ 346s] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
[ 346s] api/qcoloroutput_p.h:74:60: error: shift expression '(1048575 << 20)' overflows [-fpermissive]
[ 346s] api/qcoloroutput_p.h:74:63: error: enumerator value for 'BackgroundMask' is not an integer constant
[ 346s] BackgroundMask = ((1 << BackgroundShift) - 1) << BackgroundShift
[ 346s] ^~~~~~~~~~~~~~~
[ 346s] g++ -c -m64 -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_XMLPATTERNS_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include -I../../include/QtXmlPatterns -I.rcc/debug-shared -Iacceltree -Idata -Iapi -Ienvironment -Iexpr -Ifunctions -Iiterators -Ijanitors -Iparser -Ischema -Itype -Iutils -I.moc/debug-shared -o .obj/debug-shared/qabstractxmlnodemodel.o api/qabstractxmlnodemodel.cpp
[ 347s] g++ -c -m64 -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_XMLPATTERNS_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include -I../../include/QtXmlPatterns -I.rcc/debug-shared -Iacceltree -Idata -Iapi -Ienvironment -Iexpr -Ifunctions -Iiterators -Ijanitors -Iparser -Ischema -Itype -Iutils -I.moc/debug-shared -o .obj/debug-shared/qabstractxmlpullprovider.o api/qabstractxmlpullprovider.cpp
[ 347s] make[1]: *** [Makefile:2578: .obj/debug-shared/qvariableloader.o] Error 1

The full buildlog can be viewed there: https://build.opensuse.org/build/Documentation:Publican/openSUSE_Tumbleweed/x86_64/wkhtmltopdf-qt/_log
The current patches and rpm-specfile can be viewed there: https://build.opensuse.org/package/show/Documentation:Publican/wkhtmltopdf-qt

HTML input fields not fillible

I just updated from 12.3 to 12.4 to fix an issue where fallible fields do not show text when printed. After the update those input fields are no longer fillable, and I have --enable-forms in the CLI. This is a PHP script I am working with. For now I have reverted to the old version so my users are not impacted, but any advice on this would be very appreciated.

Need to add woff font support in wkhtmltopdf

Hi all ,

i have convert html to pdf file using wkhtmltopdf source with qtwebkit 5.3.1 assemblies while using woff font in html file it looks fine in web browser but in pdf it looks like normal font .and getting warning "woff font requires qtwebkit need to build with zlib support " so i again build the qtsource with both -qt-zlib and -system-zlib configure command but still i am getiing the same warning and woff font not yet supported.so pls share your ideas with me.

Regards,
premji

memory is leak?

QList QWin32PrintEnginePrivate::queryResolutions() const
{
// Read the supported resolutions of the printer.
QList list;

DWORD numRes = DeviceCapabilities(reinterpret_cast<const wchar_t *>(name.utf16()),
                                  reinterpret_cast<const wchar_t *>(port.utf16()),
                                  DC_ENUMRESOLUTIONS, 0, 0);
if (numRes == (DWORD)-1)
    return list;

LONG *enumRes = (LONG*)malloc(numRes * 2 * sizeof(LONG));

//-----------------\
the enumRes not free ?

build breaks while problem with typename

Actual i have a build break:

[ 679s] ../3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:272:89: error: call of overloaded 'swap(std::pair<QTWTF::RefPtrQTJSC::UStringImpl, QTJSC::OffsetLocation>&, std::pair<QTWTF::RefPtrQTJSC::UStringImpl, QTJSC::OffsetLocation>&)' is ambiguous
[ 679s] template struct Mover<T, true> { static void move(T& from, T& to) { swap(from, to); } };
[ 679s] ~~~~^~~~~~~~~~
[ 679s] In file included from /usr/include/c++/6/utility:70:0,
[ 679s] from /usr/include/c++/6/algorithm:60,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h:24,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/wtf/HashFunctions.h:24,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/wtf/HashTraits.h:24,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h:33,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h:32,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/ArgList.h:25,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:26,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/InternalFunction.h:27,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h:29,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp:28:
[ 679s] /usr/include/c++/6/bits/stl_pair.h:471:5: note: candidate: void std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&) [with _T1 = QTWTF::RefPtrQTJSC::UStringImpl; _T2 = QTJSC::OffsetLocation]
[ 679s] swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
[ 679s] ^~~~
[ 679s] In file included from /usr/include/c++/6/bits/nested_exception.h:40:0,
[ 679s] from /usr/include/c++/6/exception:171,
[ 679s] from /usr/include/c++/6/new:40,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h:27,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/config.h:68,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp:26:
[ 679s] /usr/include/c++/6/bits/move.h:179:5: note: candidate: typename std::enable_if<std::_and<std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type std::swap(_Tp&, _Tp&) [with _Tp = std::pair<QTWTF::RefPtrQTJSC::UStringImpl, QTJSC::OffsetLocation>; typename std::enable_if<std::_and<std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type = void]
[ 679s] swap(_Tp& __a, _Tp& __b)
[ 679s] ^~~~
[ 679s] In file include[ 657.785875] serial8250: too much work for irq4
[ 679s] d from ../3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h:25:0,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/ArgList.h:26,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:26,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/runtime/InternalFunction.h:27,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h:29,
[ 679s] from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp:28:
[ 679s] ../3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:264:50: note: candidate: void QTWTF::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&) [with T = QTWTF::RefPtrQTJSC::UStringImpl; U = QTJSC::OffsetLocation]
[ 679s] template<typename T, typename U> inline void swap(pair<T, U>& a, pair<T, U>& b)
[ 679s] ^~~~
[ 679s] make[1]: *** [Makefile:2647: obj/debug/JSCallbackFunction.o] Error 1

Full build log: https://build.opensuse.org/build/Documentation:Publican/openSUSE_Tumbleweed/x86_64/wkhtmltopdf-qt/_log

Failed to compile

I was trying to compile qt on archlinux but the compilation failed.
using this config : ./configure -static -prefix /opt/qt/
then: make
here is the output qt error.txt

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.