profile
viewpoint
wkhtmltopdf wkhtmltopdf https://wkhtmltopdf.org Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf/wkhtmltopdf 10310

Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf/packaging 77

Packaging of wkhtmltopdf releases

wkhtmltopdf/qt 30

forked Qt 4.8 with wkhtmltopdf-specific patches

wkhtmltopdf/obsolete-downloads 3

Obsolete downloads - DO NOT USE!

issue commentwkhtmltopdf/wkhtmltopdf

WKHTMLTOPDF unable to create PDF from React app (using Create React App)

Hi!, same problem :( someone find a solution?

sbitproz

comment created time in 4 hours

issue openedwkhtmltopdf/wkhtmltopdf

Exit with code 1 due to network error: HostNotFoundError

wkhtmltopdf version(s) affected: x.y.z

OS information <!-- Your OS specification -->

Description <!-- A clear and concise description of the problem. -->

This error is showing when I try to style table of contents with xsl stylesheet. Locally it's working well, but in production mode did not work. Has anyone else face similiar problem

How to reproduce <!-- Html/css code and/or command line arguments needed to reproduce the problem. -->

Expected behavior <!-- A clear and concise description of what you expected to happen. -->

Possible Solution
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->

created time in 5 hours

startedwkhtmltopdf/wkhtmltopdf

started time in 6 hours

issue openedwkhtmltopdf/wkhtmltopdf

Missing styles and images

wkhtmltopdf version(s) affected: 0.12.6

OS information Ubuntu 16.04.7 LTS / i686

Description Generated PDF does not include CSS styling and images. Screenshot 2020-12-03 at 14 10 54

It seems to be similar to #4377, but I had no errors during installation or execution.

How to reproduce Installation with no error:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.xenial_i386.deb
sudo dpkg -i wkhtmltox_0.12.6-1.xenial_i386.deb

Generating a PDF without error:

$ wkhtmltopdf --version
wkhtmltopdf 0.12.6 (with patched qt)
  
$ wkhtmltopdf http://google.com google.pdf
Loading pages (1/6)
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done 

Also tested v0.12.5 with the same result. Works fine only on v0.12.4 or earlier.

Expected behavior

Expected styles and images included as below. Screenshot 2020-12-03 at 14 18 22

Possible Solution
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->

created time in 7 hours

issue commentwkhtmltopdf/wkhtmltopdf

Fonts always appear bolded when printing HTML page.

In my case, it was expecting NimbusSanL-Regu font which I installed it via

apt install gsfonts

joeysr20det

comment created time in 10 hours

issue commentwkhtmltopdf/wkhtmltopdf

Exit with code 1 due to network error: HostNotFoundError

Request to reopen this issue

I am getting this error too despite of passing --load-error-handling ignore flag. In our case we cannot control URL's, since user is pasting content from external source (say internet). I am wondering why it is still throwing HostNotFoundError even after including the required ignore flag

C:\Users\neeraj.x.mathur>D:\temp\HtmlToPdf\wkhtmltopdf.exe --load-error-handling ignore --disable-javascript --disable-external-links --disable-internal-links "http://XXX/Message/PdfSnapshot/MessageCopy/23423?IsEmailRendering=True&userid=65374&usertypeid=63" D:\Temp\abc.pdf Loading pages (1/6) Error: Failed to load https:/images?q=tbn:ANd9GcQfaSPCKLwxcSVAooxEWcM77EoUp35icCgdXjcsQdPj8mQEZsz-Eg, with network status code 3 and http status code 0 - Host not found Error: Failed to load https:/images?q=tbn:ANd9GcTia8nYc0xmdwpK94pulGCw-PnLhsd55fP_RIZZ1gmKEL7eIjjd, with network status code 3 and http status code 0 - Host no t found Error: Failed to load https:/images?q=tbn:ANd9GcQDpw0hVBXwCVPGuUVV3QQwGavSyR-yTynlQUx6k-1kNiFoCKWV, with network status code 3 and http status code 0 - Host no t found Counting pages (2/6) Resolving links (4/6) Loading headers and footers (5/6) Printing pages (6/6) Done Exit with code 1 due to network error: HostNotFoundError

damienh

comment created time in 11 hours

issue closedwkhtmltopdf/wkhtmltopdf

Image not showing

wkhtmltopdf version(s) affected: 1.6.1

OS information macOS Mojave Version 10.14.6

Description I want to create simple biodata with HTML file. I try to add floating image (profile picture) at right corner, but the image is not showing

How to reproduce This is my sample test.html file

<!DOCTYPE html>
<html>
<body style="padding: 50px; text-align: justify;">
    <h1 style="text-align: center;">Biodata</h1>
    <br>
    <div style="float: right; margin-bottom: 30px;">
      
    </div>
    <div>
    <strong>Name:</strong> John
    </div>
    <br>
    <strong>Birth date:</strong> 2001-01-01
    <br>
    <br>
    <strong>Birth place:</strong> Unknown
    <br>
    <br>
    <Strong>Sex:</Strong> Male/Female
    <br>
    <br>
    <strong>Height:</strong> 200 cm
    <br>
    <br>
    <strong>Hobby:</strong> Sleeping
    <br>
</body>
</html>

This is the Go code

import (
	"bytes"
	"fmt"
	"html/template"
	"strings"

	gopdf "github.com/SebastiaanKlippert/go-wkhtmltopdf"
)

func init() {
	htmlTmp, err := template.ParseFiles("files/html/test.html")
	if err != nil {
		fmt.Println(err)
		return
	}

	buf := new(bytes.Buffer)
	err = htmlTmp.Execute(buf, nil)
	if err != nil {
		fmt.Println(err)
		return
	}

	pdfGen, err := gopdf.NewPDFGenerator()
	if err != nil {
		fmt.Println(err)
		return
	}

	pageReader := gopdf.NewPageReader(strings.NewReader(buf.String()))
	pageReader.PageOptions.EnableLocalFileAccess.Set(true)
	pdfGen.AddPage(pageReader)
	if err := pdfGen.Create(); err != nil {
		fmt.Println(err)
		return
	}

	if err := pdfGen.WriteFile("files/generated/test.pdf"); err != nil {
		fmt.Println(err)
		return
	}
}

This is what it looks like when I run the code test8.pdf

I already use the option to enable local file access, but the image is still not showing. Instead, there is a block at where the image should be showing

Expected behavior I try to use wkhtmltopdf from command line to see the differences

wkhtmltopdf --enable-local-file-access files/html/test.html files/generated/test.pdf

This is the result test7.pdf

It shows the image where I want them to be

closed time in 11 hours

aldoplianto

issue openedwkhtmltopdf/wkhtmltopdf

Image not showing

wkhtmltopdf version(s) affected: 1.6.1

OS information macOS Mojave Version 10.14.6

Description I want to create simple biodata with HTML file. I try to add floating image (profile picture) at right corner, but the image is not showing

How to reproduce This is my sample test.html file <!DOCTYPE html> <html> <body style="padding: 50px; text-align: justify;"> <h1 style="text-align: center;">Biodata</h1> <br> <div style="float: right; margin-bottom: 30px;"> </div> <div> <strong>Name:</strong> John </div> <br> <strong>Birth date:</strong> 2001-01-01 <br> <br> <strong>Birth place:</strong> Unknown <br> <br> <Strong>Sex:</Strong> Male/Female <br> <br> <strong>Height:</strong> 200 cm <br> <br> <strong>Hobby:</strong> Sleeping <br> </body> </html>

This is the Go code `import ( "bytes" "fmt" "html/template" "strings"

gopdf "github.com/SebastiaanKlippert/go-wkhtmltopdf"

)

func init() { htmlTmp, err := template.ParseFiles("files/html/test.html") if err != nil { fmt.Println(err) return }

buf := new(bytes.Buffer)
err = htmlTmp.Execute(buf, nil)
if err != nil {
	fmt.Println(err)
	return
}

pdfGen, err := gopdf.NewPDFGenerator()
if err != nil {
	fmt.Println(err)
	return
}

pageReader := gopdf.NewPageReader(strings.NewReader(buf.String()))
pageReader.PageOptions.EnableLocalFileAccess.Set(true)
pdfGen.AddPage(pageReader)
if err := pdfGen.Create(); err != nil {
	fmt.Println(err)
	return
}

if err := pdfGen.WriteFile("files/generated/test.pdf"); err != nil {
	fmt.Println(err)
	return
}

}`

This is what it looks like when I run the code test8.pdf

I already use the option to enable local file access, but the image is still not showing. Instead, there is a block at where the image should be showing

Expected behavior I try to use wkhtmltopdf from command line to see the differences

wkhtmltopdf --enable-local-file-access files/html/test.html files/generated/test.pdf

This is the result test7.pdf

It shows the image where I want them to be

created time in 12 hours

issue commentwkhtmltopdf/wkhtmltopdf

Exit with code 1 due to network error: ProtocolUnknownError

What's your wkhtmltopdf version?

Zswdhy

comment created time in 12 hours

startedwkhtmltopdf/wkhtmltopdf

started time in 13 hours

fork luyuanerp/wkhtmltopdf

Convert HTML to PDF using Webkit (QtWebKit)

https://wkhtmltopdf.org

fork in 18 hours

issue commentwkhtmltopdf/wkhtmltopdf

Page Break in PDF

Any news on this issue? The CSS property page-break-* also does not create a page break in the PDF for me. wkhtmltopdf version 0.12.6

moh-samadieh

comment created time in a day

startedwkhtmltopdf/wkhtmltopdf

started time in a day

startedwkhtmltopdf/wkhtmltopdf

started time in a day

startedwkhtmltopdf/wkhtmltopdf

started time in a day

issue commentwkhtmltopdf/wkhtmltopdf

Chinese Characters Missing

Sounds good. Just be careful with using WOFF fonts -- check that PDF text is still selectable and copyable. I've heard of WOFF fonts sometimes being drawn as graphics instead of text, resulting in the text being visible, but not selectable.

joel-st

comment created time in a day

startedwkhtmltopdf/wkhtmltopdf

started time in a day

issue closedwkhtmltopdf/wkhtmltopdf

Chinese Characters Missing

wkhtmltopdf version(s) affected: ^2.4

OS information Linux Webserver | PHP 7.3

Description Not possible to use Chinese characters in PDF. All other characters looking good, just not possible to get the chinese chars.

How to reproduce We create PDF's by the following template: English Chinese

The generated PDF's are well except the chinese characters: English Chinese

Expected behaviour Normal appearance of Chinese characters.

Possible Solution
Wait until document is ready. I've added the --window-status ready flag.

return new Pdf(
	[
		'binary'         => '/usr/local/bin/wkhtmltopdf -O Landscape --window-status ready',
		'ignoreWarnings' => true,
		'margin-top'     => 0,
		'margin-bottom'  => 0,
		'margin-left'    => 0,
		'margin-right'   => 0,
		'disable-smart-shrinking',
	]
);

Then on each PDF template before closing the body tag, I've added <script>window.status = 'ready';</script>

Thank you for any hint or help!

Note I've already tried it by replacing the custom font with a system font – no luck

closed time in a day

joel-st

issue commentwkhtmltopdf/wkhtmltopdf

Chinese Characters Missing

It seems to be a font specific issue. To come to this point, I tried several things:

  • Convert the font to woff with transfonter
  • Convert the font to woff with fontsquirrel
  • Check the suspicious Characters in the Font Application on my computer (Chinese Chars result in squares) – After converting the font with fontsquirrel, wkhtmltopdf also prints the Chinese Chars as squares.

Since the squares are visible, and this shows it is a font specific issue, I will close this issue.

joel-st

comment created time in a day

startedwkhtmltopdf/wkhtmltopdf

started time in a day

startedwkhtmltopdf/wkhtmltopdf

started time in 2 days

issue commentwkhtmltopdf/wkhtmltopdf

--user-style-sheet does not work on Windows

我也遇到了这个问题,但是按照你们上面说的还是没起作用

veptune

comment created time in 2 days

startedwkhtmltopdf/wkhtmltopdf

started time in 2 days

issue commentwkhtmltopdf/wkhtmltopdf

Please add Alpine to list of stable releases

I eventually wandered around and found this: https://github.com/madnight/docker-alpine-wkhtmltopdf/issues/10

Thank you for maintaining this. Please feel free to close this issue

RKdev

comment created time in 2 days

issue commentwkhtmltopdf/wkhtmltopdf

overlapping text when repeating headers/footers in table

I had the same issue. The most discussed solution below did not resolve the issue.

thead { display: table-header-group; }
tfoot { display: table-row-group; }
tr { page-break-inside: avoid; }

Eventually I found that one of the parent divs for the table had position:relative; top:40px. This seems to confuse Chrome. The workaround is to make sure that none of the divs that the table is inside have a relative position. So in my case I had to add:

@media print {
    .content-page { position: initial; top: 0 }
}

Chrome should be fixed so that thead location is not confused by relative positioning of a parent div.

See attached jsfiddle for example of the issue: https://jsfiddle.net/kghandi/z1yj5okm/

rnenjoy

comment created time in 2 days

startedwkhtmltopdf/wkhtmltopdf

started time in 2 days

issue openedwkhtmltopdf/wkhtmltopdf

Please add Alpine to list of stable releases

Description I've been down quite the rabbit-hole trying to use wkthmltopdf in our environment. The list of supported OS's for this project is impressive.

As noted on the downloads page:

But due to the rise of Docker, the alpine image became very popular.

Given the popularity of Alpine are there any plans to add it as a supported binary? If not I would to make that request.

I apologize if this is not the correct place to ask this question.

created time in 2 days

startedwkhtmltopdf/wkhtmltopdf

started time in 2 days

startedwkhtmltopdf/wkhtmltopdf

started time in 2 days

PR opened wkhtmltopdf/wkhtmltopdf

Correct "Qt"'s capitalization.

"QT" is https://en.wikipedia.org/wiki/QuickTime .

Correct some other grammar.

I hereby place my changes under CC0:

https://github.com/shlomif/shlomif-computer-settings/blob/34cab2c6dd5a0a1a1fd34ed8fbb558e65e1abc0d/shlomif-settings/git/commit-messages/cc0-copyright-disclaimer.txt

[ Untested! ]

+26 -26

0 comment

13 changed files

pr created time in 2 days

more