fromUri

Creates HTML-to-PDF converter from Uri. Supported URIs are:

  • Local URIs with schemes "file://" and "content://". This includes Android resources and assets (i.e. "file:///android_res/" and "file:///android_asset/").
  • Remote URIs with schemes "http://" and "https://".

NOTE Since Nutrient for Android 10.4, we can no longer access files outside of assets/resources due to security concerns flagged up in the Android Framework. If you need data from files outside assets, you can convert them to string and use fromHtmlString.

Converter will try to load all linked resources (images, stylesheets, JavaScript etc.), if they are accessible. You can provide otherwise inaccessible resources or override default ones by setting custom ResourceInterceptor via setResourceInterceptor.

Parameters

context

The context to use.

uri

Base URI for the HTML content that should be converted to PDF.