0

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;
        }
theNoob
  • 173
  • 1
  • 9
  • "I am simply trying to convert a html file to pdf." Its definitely not simple, in fact, I am not aware of any completely server less, device only, HTML to PDF conversions for UWP. Who makes this HTML? Where does the HTML come from? Can you use something else, like XAML? – Ryan Nov 05 '20 at 19:22

1 Answers1

0

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.

Ryan
  • 2,473
  • 1
  • 11
  • 14