Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants