Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Process timing #36

Open
sstelmar opened this issue Apr 21, 2023 · 1 comment
Open

Process timing #36

sstelmar opened this issue Apr 21, 2023 · 1 comment

Comments

@sstelmar
Copy link

How do I get this to wait for the HTML internal Java scripts to process before converting to PDF?
I am using an external tool to create formal math expressions. See attached examples.

Base HTML document:
Calculation (2).zip

As converted by your tools:
testcalcs.pdf

As converted by https://html2pdf.com/:
Calculation.pdf

My current code:
@page "/Calcs"

@code
{
protected override async Task OnInitializedAsync()
{
PdfConvert.ConvertHtmlToPdf(new PdfDocument
{
Url = "https://localhost:44392/Calculation.html",
HeaderLeft = "[title]",
HeaderRight = "[date] [time]",
FooterCenter = "Page [page] of [topage]"

    }, new PdfOutput
    {
        OutputFilePath = "testcalcs.pdf"
    });
}

}

@mstijak
Copy link
Member

mstijak commented Apr 24, 2023

This is just a simple wrapper around wkhtmltopdf. You should check the options there.

Since this project is no longer maintained, you may also try https://www.puppeteersharp.com/ which offers the same functionality and much more.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants