Hey, Dean you must be pretty active on this forum. Iāve made a ton of progress on my project since you last helped me. And Jeff, I believe you helped on that also so thanks. Iām 72 years old and learning all this new technology in semi-retirement and can figure out most of it, but itās really nice to have forums to get past the ones I cannot figure out.
Well, installing wkhtmltopdf
got me past that issue. I installed wkhtmltopdf
and successfully created the test.pdf with the simple HTML, no error and the PDF is good. When giving it my more-complex HTML which renders fine in the browser and is about 30 lines long, I get a huge error. It does create a PDF and it is 2300 pages long, all empty until the last page which has some elements of the HTML. I will show the end:
Current assets
Bank savings account Kiribati
Long term assets
Equipment Kiribati
Current liabilities
Interest payable Kiribati Purchase Tax payable Kiribati
Long term liabilities
Mortgage loan Kiribati
Equity
Retained earnings Kiribati
Current assets total
Long term assets total
Assets total
Current liabilities total
Long term liabilities total
Equity total
Liabilities and equity total
The error is then sent to the browser via: http.Error(w, err.Error(), http.StatusInternalServerError)
Again, mostly empty pages, but here is the beginning and end:
Loading pages (1/6)
[> ] 0%
[======> ] 10%
Warning: Blocked access to file
[=====================> ] 35%
Error: Failed to load about:blank, with network status code 301 and http status code 0 - Protocol "about" is unknown
[============================================================] 100%
Counting pages (2/6)
[============================================================] Object 1 of 1
Resolving links (4/6)
[============================================================] Object 1 of 1
Loading headers and footers (5/6)
Printing pages (6/6)
[> ] Preparing
[> ] Page 1 of 2304
[> ] Page 2 of 2304
[> ] Page 3 of 2304
[> ] Page 4 of 2304
end the end:
[===========================================================>] Page 2301 of 2304
[===========================================================>] Page 2302 of 2304
[===========================================================>] Page 2303 of 2304
[============================================================] Page 2304 of 2304
Done
Exit with code 1 due to network error: ProtocolUnknownError
This page does have a thumbnail image, but I removed that and get the same results. This page is a financial statement, a balance sheet, with links on each account to a transaction detail page for the account. Maybe the wkhtmltopdf
doesnāt handle those. There are also 3 dropdowns and a button.