theNoob
theNoob

Reputation: 181

Converting html to PDF using pdftron "ToPDF cannot convert this file format on this platform"

I get the below error we do that. "ToPDF cannot convert this file format on this platform" File is available at the locations. I am simply trying to convert a html file to pdf.

bool err = false;
        try
        {
            PDFDoc pdfdoc = new PDFDoc();
            string input_file_path = Path.Combine(Directory.GetCurrentDirectory(), "test.html");
            pdftron.PDF.Convert.ToPdf(pdfdoc, input_file_path);
            pdfdoc.Destroy();
        }
        catch (Exception e)
        {
            err = true;
        }

Upvotes: 0

Views: 325

Answers (1)

Ryan
Ryan

Reputation: 2570

HTML to PDF conversion on UWP is not currently available.

In fact, I am not aware of any completely server less, device only, HTML to PDF conversions for UWP.

At least not any solution that can handle any HTML input, and convert to PDF. There may be solutions if your HTML is a very narrow and known subset of HTML/CSS/JS.

Instead, for general HTML to PDF conversion on mobile, you would utilize a server component.

Upvotes: 0

Related Questions