Convert HTML to PDF using Webkit (QtWebKit)

Related tags

PDF wkhtmltopdf
Overview

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 http://wkhtmltopdf.org for updated documentation.

Building

wkhtmltopdf has its own dedicated repository for building and packaging.

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

Comments
  • QSslSocket: cannot resolve SSLv3_client_method / SSLv3_server_method

    QSslSocket: cannot resolve SSLv3_client_method / SSLv3_server_method

    Edit

    Fixed in 0.12.5 - Please update to this version.

    !! Note that downgrading openssl is not a solution !!

    Original issue

    Ubuntu Ubuntu 14.04.4 LTS

    Loading pages (1/6)
    QSslSocket: cannot resolve SSLv3_client_method               ] 10%
    QSslSocket: cannot resolve SSLv3_server_method
    

    I have libssl-dev and openssl installed.

    wkhtmltopdf --version
    wkhtmltopdf 0.12.3 (with patched qt)
    
    Fixed 
    opened by cdfre 179
  • crashes when rendering JPEG images on Windows Server 2008 x64

    crashes when rendering JPEG images on Windows Server 2008 x64

    Hi,

    Rendering a page with JPG images crashes on Windows Server 2008 in step 6. It works on Windows 8. I believe this only occurs on websites that use JPG images.

    For instance this works:

    wkhtmltopdf.exe "http://www.google.com" test.pdf

    But this doesn't:

    wkhtmltopdf.exe "http://news.bbc.co.uk" test.pdf

    I believe it is the same issue as this: https://code.google.com/p/wkhtmltopdf/issues/detail?id=301

    Migrated-GoogleCode Fixed 
    opened by DomusMaximus 98
  • PDFs rendering without embedded fonts on OS X

    PDFs rendering without embedded fonts on OS X

    Rendering a completely blank HTML file on OS X:

    • 0.12.1 generates a 4 KB file
    • 0.10.0 RC2 generates a 1 KB file

    Pages with more HTML see a similar ratio:

    • 0.12.1 generates a 648 KB file
    • 0.10.0 RC2 generates a 111 KB file
    Fixed 
    opened by dan-mesa 92
  • Huge Font Size Difference Between 0.12.3 and 0.12.4

    Huge Font Size Difference Between 0.12.3 and 0.12.4

    This is a comparison between the output created by the Mac OS X version of 0.12.3 and 0.12.4 - I consider what I see with 0.12.3 the correct output.

    I am running the software on Mac OS X 10.11.6

    This test was done using these builds downloaded from the official web site:

    wkhtmltox-0.12.3_osx-cocoa-x86-64.pkg wkhtmltox-0.12.4_osx-cocoa-x86-64.pkg

    I use a very simple HTML file that only contains a few headers from h1 to h3 plus some lorem ipsum sample text in p tags.

    The HTML file was converted using no command line options besides the input and the output file:

    wkhtmltopdf test.html test.pdf

    Here is the sample HTML file (renamed to .txt to be able to attach it): test.txt

    And here are the two output files created by the two different wkhtmltopdf versions: test_0.12.3.pdf test_0.12.4.pdf

    The paragraph text in the 0.12.3 version if about 12.3pt in size, whereas the 0.12.4 version creates 3.07pt text. It seems that all text is by a factor of 4 too small.

    This may be related to the other "font size is too small" problems, but what I am seeing seems to be much more extreme than anything else I've found so far.

    Fixed 
    opened by khkremer 84
  • scripts/build.py fails on OpenBSD 5.5

    scripts/build.py fails on OpenBSD 5.5

    I would like to compile wkhtmltox 0.12.1 on my OpenBSD 5.5 machine but unfortunately it already fails while running "./scripts/build.py posix-local" as you can see below:

    ...
    Creating qmake. Please wait...
    qbytearray.o(.text+0x2d92): In function `qstrcpy(char*, char const*)':
    /home/user/src/wkhtmltox-0.12.1/qt/src/corelib/tools/qbytearray.cpp:143: warning: strcpy() is almost always misused, please use strlcpy()
    qglobal.o(.text+0x267): In function `qrand()':
    /home/user/src/wkhtmltox-0.12.1/qt/src/corelib/global/qglobal.cpp:2746: warning: rand() isn't random; consider using arc4random()
    qglobal.o(.text+0x27d): In function `qsrand(unsigned int)':
    /home/user/src/wkhtmltox-0.12.1/qt/src/corelib/global/qglobal.cpp:2705: warning: srand() seed choices are invariably poor
    option.o(.text+0xe95): In function `qmake_version()':
    /home/user/src/wkhtmltox-0.12.1/static-build/posix-local/qt/qmake/option.cpp:695: warning: sprintf() is often misused, please use snprintf()
    Iconv support cannot be enabled due to functionality tests!
     Turn on verbose messaging (-v) to ../../../qt/configure to see the final report.
     If you believe this message is in error you may use the continue
     switch (-continue) to ../../../qt/configure to continue.
    ../../../qt/configure -opensource -confirm-license -fast -release -static -graphicssystem raster -webkit -exceptions -xmlpatterns -system-zlib -system-libpng -system-libjpeg -no-libmng -no-libtiff -no-accessibility -no-stl -no-qt3support -no-phonon -no-phonon-backend -no-opengl -no-declarative -no-script -no-scripttools -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-mmx -no-3dnow -no-sse -no-sse2 -no-multimedia -nomake demos -nomake docs -nomake examples -nomake tools -nomake tests -nomake translations -silent -xrender -largefile -iconv -openssl -no-rpath -no-dbus -no-nis -no-cups -no-pch -no-gtkstyle -no-nas-sound -no-sm -no-xshape -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-mitshm -no-xinput -no-xkb -no-glib -no-gstreamer -D ENABLE_VIDEO=0 -no-openvg -no-xsync -no-audio-backend -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon --prefix=/home/user/src/wkhtmltox-0.12.1/static-build/posix-local/qt
    command failed: exit code 25856
    

    any ideas what I am missing or whats wrong?

    opened by hostingnuggets 76
  • bad kerning for fonts in output PDF

    bad kerning for fonts in output PDF

    This is the old Issue #72 from Google Code, first reported in 2009. It still occurs with the dev branch of 0.12.0, tested with commit d6541feaaa8253516c92faae34293430efeb070a .

    What steps will reproduce the problem?

    1. Generate PDF from any HTML input with wkhtmltopdf via e.g.

      ./wkhtmltopdf test.html test.pdf
      
    2. View it. Tested with Evince, Xpdf and Chrome's built-in PDF reader with similar results.

    What is the expected output? What do you see instead? Expected: A PDF rendering similar to the one seen of the HTML document in a browser, specifically concerning the letter-spacing.

    Result: The kerning is way off. Sometimes too expanded, sometimes too condensed. See attached sample rendering of (from left to right):

    1. an HTML document rendered by a browser (Chrome)
    2. the resulting PDF rendered by Chrome's built-in PDF reader
    3. the resulting PDF rendered by Evince

    What version of the product are you using? On what operating system? Dev branch of 0.12.0, tested with commit d6541feaaa8253516c92faae34293430efeb070a . Debian Sid, i386. Using the binary that resulted after building the Git revision with:

    ./build_linux.sh linux-i386
    

    I have tested earlier versions of Wkhtmlpdf on Fedora (amd64) with identical results.

    Please provide any additional information below. I include the sample document and rendering below, but it happens with everything I throw to Wkhtmltopdf, so I don't think there are any specific "clues" in the minimal HTML code.

    Migrated-GoogleCode Documentation 
    opened by dandersson 76
  • ignore untracked files generated during the build

    ignore untracked files generated during the build

    Ignore the following untracked files which are generated during the MSVC build:

    # HEAD detached at 924bcb7
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #
    #       src/image/Makefile.Debug
    #       src/image/Makefile.Release
    #       src/image/wkhtmltoimage_resource.rc
    #       src/lib/Makefile.Debug
    #       src/lib/Makefile.Release
    #       src/lib/wkhtmltox_resource.rc
    #       src/pdf/Makefile.Debug
    #       src/pdf/Makefile.Release
    #       src/pdf/wkhtmltopdf_resource.rc
    
    opened by ashkulz 67
  • crash in wkhtmltopdf::PdfConverterPrivate::printDocument

    crash in wkhtmltopdf::PdfConverterPrivate::printDocument

    This is a freshly compiled (and freshly pulled) ubuntu-precise debug build. If you tell me what command to run I can provide you the exact version ;)

    ...
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Qt: gdb: -nograb added to command-line options.
         Use the -dograb option to enforce grabbing.
    ...
    Printing pages (6/6)
    ASSERT failure in QList<T>::operator[]: "index out of range", file ../../../qt/include/QtCore/../../../../../qt/src/corelib/tools/qlist.h, line 477
    
    Program received signal SIGABRT, Aborted.
    0x00007ffff5b76425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
    (gdb) bt all
    #0  0x00007ffff5b76425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
    #1  0x00007ffff5b79b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
    #2  0x0000000001eb96bf in qt_message_output (msgType=QtFatalMsg,
        buf=0x3a21d28 "ASSERT failure in QList<T>::operator[]: \"index out of range\", file ../../../qt/include/QtCore/../../../../../qt/src/corelib/tools/qlist.h, line 477") at /var/home/builder/wkhtmltopdf/qt/src/corelib/global/qglobal.cpp:2359
    #3  0x0000000001eb9855 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg,
        msg=0x26fa378 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fffffff5c28)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/global/qglobal.cpp:2405
    #4  0x0000000001eb9f40 in qFatal (msg=0x26fa378 "ASSERT failure in %s: \"%s\", file %s, line %d")
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/global/qglobal.cpp:2588
    #5  0x0000000001eb92c3 in qt_assert_x (where=0x205a7ca "QList<T>::operator[]", what=0x205a7b7 "index out of range",
        file=0x205a770 "../../../qt/include/QtCore/../../../../../qt/src/corelib/tools/qlist.h", line=477)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/global/qglobal.cpp:2062
    #6  0x000000000043f27d in QList<QWebPage*>::operator[] (this=0x3659438, i=15)
        at ../../../qt/include/QtCore/../../../../../qt/src/corelib/tools/qlist.h:477
    #7  0x000000000043bfd8 in wkhtmltopdf::PdfConverterPrivate::printDocument (this=0x3673110) at /var/home/builder/wkhtmltopdf/src/lib/pdfconverter.cc:982
    #8  0x0000000000439c7e in wkhtmltopdf::PdfConverterPrivate::headersLoaded (this=0x3673110, ok=true)
        at /var/home/builder/wkhtmltopdf/src/lib/pdfconverter.cc:799
    #9  0x0000000000459398 in wkhtmltopdf::PdfConverterPrivate::qt_static_metacall (_o=0x3673110, _c=QMetaObject::InvokeMetaMethod, _id=3,
        _a=0x7fffffff5f90) at moc_pdfconverter_p.cpp:61
    #10 0x0000000001fda566 in QMetaObject::activate (sender=0x3673220, m=0x2062a00, local_signal_index=0, argv=0x7fffffff5f90)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qobject.cpp:3567
    #11 0x000000000045a3be in wkhtmltopdf::MultiPageLoader::loadFinished (this=0x3673220, _t1=true) at moc_multipageloader.cpp:117
    #12 0x0000000000423efd in wkhtmltopdf::MultiPageLoaderPrivate::loadDone (this=0x36766f0) at /var/home/builder/wkhtmltopdf/src/lib/multipageloader.cc:477
    #13 0x00000000004223ec in wkhtmltopdf::ResourceObject::loadDone (this=0x38a6c80) at /var/home/builder/wkhtmltopdf/src/lib/multipageloader.cc:291
    #14 0x0000000000458bcb in wkhtmltopdf::ResourceObject::qt_static_metacall (_o=0x38a6c80, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0x7fffffff6080)
        at moc_multipageloader_p.cpp:229
    #15 0x0000000001fda566 in QMetaObject::activate (sender=0x38a8cc0, m=0x35db840, local_signal_index=0, argv=0x0)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qobject.cpp:3567
    #16 0x0000000001fdfbcf in QSingleShotTimer::timeout (this=0x38a8cc0) at .moc/debug-static/qtimer.moc:96
    #17 0x0000000001fdfa2b in QSingleShotTimer::timerEvent (this=0x38a8cc0) at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qtimer.cpp:317
    #18 0x0000000001fd54ee in QObject::event (this=0x38a8cc0, e=0x7fffffff6930) at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qobject.cpp:1184
    #19 0x00000000016ca9f6 in QApplicationPrivate::notify_helper (this=0x3643bf0, receiver=0x38a8cc0, e=0x7fffffff6930)
        at /var/home/builder/wkhtmltopdf/qt/src/gui/kernel/qapplication.cpp:4565
    #20 0x00000000016c8188 in QApplication::notify (this=0x7fffffff9120, receiver=0x38a8cc0, e=0x7fffffff6930)
        at /var/home/builder/wkhtmltopdf/qt/src/gui/kernel/qapplication.cpp:3947
    #21 0x0000000001fbe9c0 in QCoreApplication::notifyInternal (this=0x7fffffff9120, receiver=0x38a8cc0, event=0x7fffffff6930)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qcoreapplication.cpp:953
    #22 0x0000000000478bb7 in QCoreApplication::sendEvent (receiver=0x38a8cc0, event=0x7fffffff6930)
        at ../../include/QtCore/../../../../../qt/src/corelib/kernel/qcoreapplication.h:231
    #23 0x0000000001fefbe0 in QTimerInfoList::activateTimers (this=0x36469e8)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qeventdispatcher_unix.cpp:621
    #24 0x0000000001ff0a4f in QEventDispatcherUNIX::activateTimers (this=0x3646160)
    ---Type <return> to continue, or q <return> to quit---
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qeventdispatcher_unix.cpp:878
    #25 0x0000000001ff0da9 in QEventDispatcherUNIX::processEvents (this=0x3646160, flags=...)
        at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qeventdispatcher_unix.cpp:940
    #26 0x0000000001fbedce in QCoreApplication::processEvents (flags=...) at /var/home/builder/wkhtmltopdf/qt/src/corelib/kernel/qcoreapplication.cpp:1140
    #27 0x0000000000428a14 in wkhtmltopdf::ConverterPrivate::convert (this=0x3673110) at /var/home/builder/wkhtmltopdf/src/lib/converter.cc:94
    #28 0x0000000000428c51 in wkhtmltopdf::Converter::convert (this=0x7fffffff9100) at /var/home/builder/wkhtmltopdf/src/lib/converter.cc:149
    #29 0x000000000044e812 in main (argc=26, argv=0x7fffffffe258) at /var/home/builder/wkhtmltopdf/src/pdf/wkhtmltopdf.cc:180
    

    commandline used:

     gdb --args ./wkhtmltopdf --'margin-top' '28' --'margin-right' '0' --'margin-bottom' '12' --'margin-left' '0' 'cover https://[host]/ihc/_idd/travelguide/cover?did=5585' --'header-html' 'https://[host]/ihc/_idd/travelguide/header?did=5585' 'toc' --'header-html' 'https://[host]/ihc/_idd/travelguide/header?did=5585' --'footer-html' 'https://[host]/ihc/_idd/travelguide/footer' --'xsl-style-sheet' '/home/freek/toc/ihc-travelguide.xsl' 'https://[host]/ihc/_idd/travelguide/guide?did=5585' --'header-html' 'https://[host]/ihc/_idd/travelguide/header?did=5585' --'footer-html' 'https://[host]/ihc/_idd/travelguide/footer' --'header-spacing' '2'
    

    (Sorry for the snipping of the host, but it's internal anyway and a bit private) Might be a continuation from #1713, dunno.

    Duplicate 
    opened by Mrten 65
  • flexbox layout doesn't work

    flexbox layout doesn't work

    Flexbox seems to be broken in wkhtmltopdf.

    Here's a test case, which renders correctly in current versions of Chrome, Firefox, and Internet Explorer. wkhtmltopdf renders it as if the flex properties were not present.

    Tested with the 0.12 Windows 32-bit download as found on http://wkhtmltopdf.org/ (wkhtmltox-win32_0.12.0-03c001d.exe). As you can see I tried using the -webkit- prefixes and they didn't help.

    <!DOCTYPE html>
    <html><head><title>Flexbox test</title>
    <style>
    body {
      width: 800px;
      border: 2px solid green;
    }
    .flexrow {
      width: 100%;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      display: -webkit-flex;
      -webkit-flex-direction: row;
      -webkit-justify-content: space-between;
    }
    .flexrow > div {
      background-color: yellow;
      border: 1px dashed black;
    }
    </style>
    </head>
    <body>
      <div class="flexrow">
        <div>This is<br>item 1</div>
        <div>This is<br>item 2</div>
        <div>This is<br>item 3</div>
        <div>This is<br>item 4</div>
        <div>This is<br>item 5</div>
      </div>
    </body>
    </html>
    
    UpstreamChangeNeeded Documentation 
    opened by tschqr 62
  • TOC support broken after upgrade to latest QT

    TOC support broken after upgrade to latest QT

    Version: wkhtmltopdf 0.12.0 OS: Centos 6.4 No TOC is being created and no error generated.

    bin/wkhtmltopdf toc http://www.w3schools.com/html/html_headings.asp w3schools.com.pdf

    Even when specifying to use xsl file, it has the same results.

    bin/wkhtmltopdf toc --xsl-style-sheet toc.xsl http://www.w3schools.com/html/html_headings.asp w3schools.com.pdf

    Regression Fixed 
    opened by Jimbobnz 62
  • Download server down

    Download server down

    For the last 6 hours or so I have not been able to download releases from https://wkhtmltopdf.org/downloads.html and the website is very slow to load in general.

    opened by dseravalli 48
  • Cannot recognize html img tag style if add img tag dynamically

    Cannot recognize html img tag style if add img tag dynamically

    wkhtmltopdf version(s) affected: 0.12.6

    OS information Windows 11

    Description What we want: image What we have under current wkhtmltopdf: image

    How to reproduce HTML code:

    <!DOCTYPE html>
    <html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    	<script>
    		window.onload = function (){
    			picImage = document.createElement("img");
    		   picImage.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAACCCAYAAACglrZ7AAAAAXNSR0IArs4c6QAAE1tJREFUeF7tnXtQF1UUxw/T2NiYaVnTqKmJ+UTAF2IKvkUER9RAJDMBxUBxoMDXGCYqiqgljWiI+EJTEF+lJuL7p/kKMXxlqKhokzlpTmaNOZ3m7KRTqezCb3+/e3f3OONf3t1z7vfz7fbb3XvPcQH+wwqwAqzAPwq4sBKsACvACjxUgBcEg3rh22+/RU9PT+ZnUH6yps2GkpVMBXktXboUZ82aBdu2bYOWLVsyQwMylDVlNpOsZJ6S15UrV7B79+4QEhICaWlpzM9g/GRPlw0lO6H/5dewYUOsVq0aXLx4kdkZjJ0R0mVTGYHSPzlu2rQJw8PDISsrC4YMGcLsDMTOKKmyqYxCCgD69u2LFy9ehAsXLjA3A3EzUqpsLIPQstls2L9/fygoKIBOnToxN4NwM1qabCyDEAsMDMRbt27B4cOHmZlBmBkxTTaXAajRnoNevXpBYmIiTJo0iZkZgJlRU2RzGYDcnDlzlH0HRUVF8MYbbzAzAzAzaopsLgOQa9myJdasWROOHTvGvAzAy8gpssEkp1dYWIjBwcGwdetW8PX1ZV6S8zJ6emwwyQm6u7sjpXjq1ClmJTkrM6THJpOY4uXLl9Hb21vZprxw4UJmJTErs6TGJpOYZH5+Po4cORK2b98OXbp0YVYSszJLamwyiUn6+/vj+fPnoaysjDlJzMlMqbHRJKZZq1YtTE1NhZiYGOYkMSczpcZGk5TmggULMCUlBb755hto1KgRc5KUk9nSYqNJSpQOMt27dw9sNhszkpSRGdNis0lKtXnz5ujj4wPZ2dnMSFJGZkyLzSYh1dOnT6Ovry+sXr0aAgMDK2S0Z88evH79Ovz2229UTg26devGTCVkapSU2DwSk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EkJAQmDBhAkyZMoU9KdAVLL5A8a0Ymt4jLFiwACIiIh55b8iQIcouRvrL5dfFuoIXBLH6Wy469V2gZiz5+fmK9/Lz83HkyJHQo0cP2Lx5M/tRsCMYgGAAVgvfvn17rFatGhw5csSFCqf4+/tD7dq14fz58+xFCczAECSAYKUUwsPDsbCwkAqlUFUkuH//PmzcuFFTu3gr6SRqrrwgiFLeonHXrFmDY8aMeTT7kpIS3pUokRd4QZAIhlVSyczMxJs3bwLVWfTx8WEPSgSeYUgEg1NhBUQrwAuCaAIcnxWQSIG/Aao2St2eKgwkAAAAAElFTkSuQmCC";
    			picImage.alt = "picture";
    			// This style is not working in wkhtmltopdf
    			picImage.style="position: absolute; top: 300px; left: 200px;";
    			document.body.appendChild(picImage);
    		}
    	</script>
    </head>
    
    <body style="height:297mm; width:210mm;background-color:white;">
    </body>
    
    </html>
    

    Expected behavior

    When add html img tag dynamically, the style should be functional.

    Possible Solution

    I tried to add img tag statically, if so, the style can be functional successfully. However, the img is generated dynamically in our situation, so I cannot add img tag statically.

    opened by CY-Qiu 0
  • HTML page turns completely white/empty

    HTML page turns completely white/empty

    wkhtmltopdf version(s) affected:

    0.12.6 (with patched qt)


    OS information

    Also tested within docker

    NAME="Linux Mint"
    VERSION="19.1 (Tessa)"
    ID=linuxmint
    ID_LIKE=ubuntu
    PRETTY_NAME="Linux Mint 19.1"
    VERSION_ID="19.1"
    HOME_URL="https://www.linuxmint.com/"
    SUPPORT_URL="https://forums.linuxmint.com/"
    BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
    PRIVACY_POLICY_URL="https://www.linuxmint.com/"
    VERSION_CODENAME=tessa
    UBUNTU_CODENAME=bionic
    

    Description

    When trying to convert this HTML page ( link ) to PDF the result is blank / empty

    This is the output from the terminal:

    root@mateus-pc:/tmp# wkhtmltopdf http://f1bratelecom.com.br/p/inv?sd=iEs9lYET9WF%2FclABZLYEOsn7AUdbJqI%3D ./fibra.pdf 
    Loading pages (1/6)
    Counting pages (2/6)                                               
    Resolving links (4/6)                                                       
    Loading headers and footers (5/6)                                           
    Printing pages (6/6)
    Done                                                                      
    root@mateus-pc:/tmp# 
    

    How to reproduce

    Run this command wkhtmltopdf http://f1bratelecom.com.br/p/inv?sd=iEs9lYET9WF%2FclABZLYEOsn7AUdbJqI%3D ./fibra.pdf

    Open the output file and note that it will be completely empty/blank


    Expected behavior

    That the HTML page was converted to HTML completely as displayed in browsers

    Captura de tela de 2022-12-28 14-51-01


    Possible Solution

    I believe the problem is due to the HTML being rendered by Angular

    opened by mateusfmello 0
  • ContentNotFoundError is thrown if HTML file contains links to filenames with multiple dots '.'

    ContentNotFoundError is thrown if HTML file contains links to filenames with multiple dots '.'

    wkhtmltopdf version(s) affected: 0.12.6

    OS information Windows 10, 64Bit

    Description When the HTML file to be converted contains 'link' entries or 'script' entries referring to files with multiple dots in the filename, wkhtmltopdf returns with error

    How to reproduce A sample line is a link entry containing href="/assets/vendors/node_modules/font/css/materialdesignicons.min.css?tag={{ back_tag }}" rel="stylesheet" media="screen,projection,print". If I use the same line but without .min in the css filename everything is fine.

    Expected behavior All filenames valid on the host system shall also be accepted by wkhtmltopdf.

    Possible Solution

    opened by Frank-knarf 0
  • PDF with hundreds of images, how to avoid loading all images concurrently

    PDF with hundreds of images, how to avoid loading all images concurrently

    We have a PDF that loads hundreds of images over HTTPS. These images seem to be loaded all at once. Is there a way to batch load the images to avoid sending too many concurrent requests to the web server?

    opened by nicodemuz 1
  • Vanilla Javascript won't render

    Vanilla Javascript won't render

    I've got a html file with very basic layout (I removed all CSS to make sure it wasn't the problem) and a Javascript section that draws a very simple pie chart. In the browser it looks fine, and I can't make out any errors in the page. Yet wkhtmltopdf won't draw the pie. What am I doing wrong? Or how can I debug this?

    I am on a Mac, OS version 11.6, wkhtmltopdf 0.12.6 (with patched qt).

    <!DOCTYPE html>
    
    <html lang="de">
    <head>
      <meta charset="utf-8">
      <title>My pie chart</title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="csrf-param" content="authenticity_token" />
      <meta name="csrf-token" content="..." />
    
    </head>
    
    <body>
    <div id="admin-main" class="container-fluid">
     
    <script type="text/javascript">
        let chartColors =  ["#172363", "#145745", "#25779D", "#28A5A9", "#3D9DD1", "#3DD1A2", "#4DC8D5", "#87E3BB", "#8BE4E1", "#C2F0C1", "#C1EDF0"];
        let fontColors = ['white','white','white', 'white','white','black','black','black','black','black','black'];
        function getPoint(c1,c2,radius,angle) {
            return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius];
        }
        function drawPie(context, legend_div, results){
            // Thanks to Sandra Moringa (https://www.section.io/engineering-education/javascript-canvas-piechart/)
            let ctx = document.getElementById(context).getContext("2d");
            let legend = document.getElementById(legend_div);
            ctx.font = 'normal 18px Arial';
    
            let totalNumberOfAnswers = results.reduce((sum, {total}) => sum + total, 0);
            let currentAngle = 0;
    
            for (let entry of results) {
                //calculating the angle the slice (portion) will take in the chart
                let portionAngle = (entry.total / totalNumberOfAnswers) * 2 * Math.PI;
                //drawing an arc and a line to the center to differentiate the slice from the rest
                ctx.beginPath();
                ctx.arc(150, 150, 150, currentAngle, currentAngle + portionAngle);
                let labelPoint = getPoint(150,150,70, currentAngle + portionAngle / 2);
                currentAngle += portionAngle;
                ctx.lineTo(150, 150);
                //filling the slices with the corresponding color
                ctx.fillStyle = entry.shade;
                ctx.fill();
                if (entry.total != 0) {
                    ctx.fillStyle = entry.textcolor;
                    ctx.fillText(entry.total, labelPoint[0], labelPoint[1]);
                };
                // Die Labels neben der Chart mit ihrer Beschriftung:
                let el = document.createElement('span');
                el.innerText = entry.answer;
                el.style.borderLeft = "35px solid " + entry.shade;
                el.style.padding = "0 10px";
                el.style.color = 'black';
                el.style.margin = "10px";
                el.style.display = "inline-block";
                legend.appendChild(el);
                legend.appendChild(document.createElement('br'));
    
            }
    
        }
    
    </script>
    
    <div class="row">
      <div class="col-12 mb20 mt30">
        <div>
          <div class="tq_questiontext">
            <h5>
              Testfrage. Soll X oder Y sein? (01.09.2022 &mdash; 30.10.2022) <span style="color:red"></span>
            </h5>
            <div>Branche(n): Möbelhaus</div>
          </div>
        </div>
      </div>
    </div>
    <div class="row tq_row">
        <div class="col-12 mb20">
          <table class="table reports-table">
            <thead>
            <tr>
              <th>
                Antwortmöglichkeit
              </th>
              <th>
                Anzahl Antworten
              </th>
              <th>%</th>
            </tr>
            </thead>
            <tbody>
              <tr>
                <td>Ich weiß nicht</td>
                <td>0</td>
                <td>0,0%</td>
              </tr>
              <tr>
                <td>X ist schön!</td>
                <td>3</td>
                <td>75,0%</td>
              </tr>
              <tr>
                <td>Y ist schöner!</td>
                <td>1</td>
                <td>25,0%</td>
              </tr>
            <tr>
              <td>
                <strong>Gesamt:</strong>
              </td>
              <td>
                <strong>4</strong>
              </td>
              <td><strong>100,0%</strong></td>
            </tr>
            </tbody>
          </table>
          <div id="tq_container" style="width:100%;margin-top:50px;" >
            <table style="border-collapse:collapse;width:100%;border:none;">
              <tr>
                <td style="text-align: right;" width="60%">
                  <canvas id="erstezelle" width="350" height="300" style="color:black;"></canvas>
                </td>
                <td id="zweitezelle"></td>
              </tr>
            </table>
    
            <script>
                  drawPie('erstezelle', 'zweitezelle', [
                          {answer: "Ich weiß nicht", total: 0, shade: chartColors[0], textcolor: fontColors[0]}, 
                          {answer: "X ist schön!", total: 3, shade: chartColors[2], textcolor: fontColors[2]}, 
                          {answer: "Y ist schöner!", total: 1, shade: chartColors[4], textcolor: fontColors[4]}, ]);
              </script>
          </div>
        </div>
    </div>
    
    </div>
    
    
    </body>
    
    </html>
    
    
    opened by DcsMarionDickten 0
Releases(0.12.6)
Owner
wkhtmltopdf
Convert HTML to PDF using Webkit (QtWebKit)
wkhtmltopdf
Convert html to an image, pdf or string

Convert a webpage to an image or pdf using headless Chrome The package can convert a webpage to an image or pdf. The conversion is done behind the sce

Spatie 4.1k Jan 1, 2023
Laravel package to convert HTML to PDF, supporting multiple drivers.

eve/pdf-converter A Laravel package to help convert HTML to PDF. Supports multiple drivers. Requirements and Installation eve/pdf-converter requires L

eve.io 11 Feb 15, 2022
Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.

Gravity PDF Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using the pop

Gravity PDF 90 Nov 14, 2022
Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2

Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2. If you have an enabled template and a default template for the store you need your template the system will print the pdf template.

EAdesign 64 Oct 18, 2021
A PHP tool that helps you write eBooks in markdown and convert to PDF.

Artwork by Eric L. Barnes and Caneco from Laravel News ❤️ . This PHP tool helps you write eBooks in markdown. Run ibis build and an eBook will be gene

Mohamed Said 1.6k Jan 2, 2023
Convert a pdf to an image

Convert a pdf to an image This package provides an easy to work with class to convert PDF's to images. Spatie is a webdesign agency in Antwerp, Belgiu

Spatie 1.1k Dec 29, 2022
HTML to PDF converter for PHP

Dompdf Dompdf is an HTML to PDF converter At its heart, dompdf is (mostly) a CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is

null 9.3k Jan 1, 2023
PHP library generating PDF files from UTF-8 encoded HTML

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF (see CREDITS), with a number of enhancement

null 3.8k Jan 2, 2023
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
PHP library allowing PDF generation or snapshot from an URL or an HTML page. Wrapper for Kozea/WeasyPrint

PhpWeasyPrint PhpWeasyPrint is a PHP library allowing PDF generation from an URL or an HTML page. It's a wrapper for WeasyPrint, a smart solution help

Pontedilana 23 Oct 28, 2022
plugin de criação de PDF através do HTML fácil

pluginmpdf plugin de criação de PDF através do HTML Para inciar nosso pluginmpdf devemos instalar a lib abaixo. mPDF is a PHP library which generates

EAD TUTORIA 2 Mar 24, 2022
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page.

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
A Laravel package for creating PDF files using LaTeX

LaraTeX A laravel package to generate PDFs using LaTeX · Report Bug · Request Feature For better visualization you can find a small Demo and the HTML

Ismael Wismann 67 Dec 28, 2022
Official clone of PHP library to generate PDF documents and barcodes

TCPDF PHP PDF Library Please consider supporting this project by making a donation via PayPal category Library author Nicola Asuni [email protected] co

Tecnick.com LTD 3.6k Jan 6, 2023
TCPDF - PHP PDF Library - https://tcpdf.org

tc-lib-pdf PHP PDF Library UNDER DEVELOPMENT (NOT READY) UPDATE: CURRENTLY ALL THE DEPENDENCY LIBRARIES ARE ALMOST COMPLETE BUT THE CORE LIBRARY STILL

Tecnick.com LTD 1.3k Dec 30, 2022
Pdf and graphic files generator library written in php

Information Examples Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a consol

Piotr Śliwa 335 Nov 26, 2022
PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.

PdfParser Pdf Parser, a standalone PHP library, provides various tools to extract data from a PDF file. Website : https://www.pdfparser.org Test the A

Sebastien MALOT 1.9k Jan 2, 2023
Laravel Snappy PDF

Snappy PDF/Image Wrapper for Laravel 5 and Lumen 5.1 This package is a ServiceProvider for Snappy: https://github.com/KnpLabs/snappy. Wkhtmltopdf Inst

Barry vd. Heuvel 2.3k Jan 2, 2023
Sign PDF files with valid x509 certificate

Sign PDF files with valid x509 certificate Require this package in your composer.json and update composer. This will download the package and the depe

Lucas Nepomuceno 175 Jan 2, 2023