How to print PDF/HTML in MAUI?

Steffen Nielsen 26 Reputation points
2022-07-05T15:24:35.27+00:00

Hello,

I have tried to find any documentation on how to print a PDF or a HTML document in the new Maui framework for Android, but i haven't been able to find anything usefull.
Are there any documentation on this, or can someome guide me in the right direction?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,957 questions
{count} vote

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 36,706 Reputation points Microsoft Vendor
    2022-07-06T06:40:17.1+00:00

    Hello,

    Currently MAUI does not have the print API to print PDF or HTML documents, you need to tap into Android native library and expose this feature for your App.

    You could refer to Printing HTML documents and Printing custom documents to get details about how to print HTML/PDF documents by native way.

    Then, you could invoke this Android native print function in your MAUI application. You could refer to Invoke platform code.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. ANDERSON DAMASIO 1 Reputation point
    2024-04-30T12:56:56.2366667+00:00

    Hi, to print Html to pdf in MAUI you can try a library:

    https://www.nuget.org/packages/HtmlToPdf.Maui

    0 comments No comments