英文:
QSslSocket: cannot resolve CRYPTO_num_locks
问题
我正在尝试使用wkhtmltopdf将HTML渲染为PDF页面。当我尝试调用Create函数时,它给我返回了一堆关于QSslSocket: cannot resolve
的错误。有人知道这里发生了什么吗?
这些是错误信息:
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
这些错误是由于缺少SSL库导致的。你需要确保在使用wkhtmltopdf之前,已经正确安装了SSL库。另外,还要确保你的代码中正确引入了相关的库文件。
英文:
I'm trying to use wkhtmltopdf to render a PDF page from HTML. When I try to call Create, it gives me bunch of errors regarding QSslSocket: cannot resolve
. Anyone knows what's happening here?
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)
}
}
These are the errors
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
答案1
得分: 1
你需要使用一个更新的版本的wkhtmltopdf,至少是0.12.5。
英文:
You need to use a more recent version of wkhtmltopdf, at least 0.12.5.
答案2
得分: 0
我找到了这个解决方案,可以解决在Oracle LINUX上运行wkhtmltopdf时的问题:
sudo -i yum install compat-openssl10.x86_64
英文:
I found this and it fixed the problem trying to run wkhtmltopdf on Oracle LINUX:
sudo -i yum install compat-openssl10.x86_64
答案3
得分: 0
我正在使用0.12.4版本,升级到了0.12.6版本。这对我解决了问题!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论