我试图使用wkhtmltopdf从HTML呈现PDF页面。当我试图调用Create时,它会给我带来许多关于QSslSocket: cannot resolve的错误。有人知道这里发生了什么吗?
func main() {
tmpl, _ := template.ParseFiles("docs/template.html")
if err != nil {
fmt.Println(err)
}
tempBuff := new(bytes.Buffer)
err = tmpl.Execute(tempBuff, data)
if err != nil {
fmt.Println(err)
}
page := wkhtmltopdf.NewPageReader(tempBuff)
pdfGen, err := wkhtmltopdf.NewPDFGenrator()
if err != nil {
fmt.Println(err)
}
pdfGen.AddPage(page)
pdfGen.Orientation.Set(wkhtmltopdf.OrientationLandscape)
pdfGen.Dpi.Set(300)
// Error happens here
err = pdfGen.Create()
if err != nil {
fmt.Println(err)
}
}这些都是错误
Loading pages (1/6)
QSslSocket: cannot resolve CRYPTO_num_locks ] 10%
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
QSslSocket: cannot call unresolved function SSLv23_client_method2%
QSslSocket: cannot call unresolved function SSL_library_init
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: UnknownNetworkError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback发布于 2022-10-25 18:00:17
我发现了这一点,并修复了在Oracle LINUX上运行wkhtmltopdf时出现的问题:
sudo -i yum install compat-openssl10.x86_64https://stackoverflow.com/questions/73849434
复制相似问题