title: How to view PDFs with pdf.js in Xamarin Forms
body: <p>I'm using Xamarin Forms' WebView control to show a PDF, the problem is that this control only renders it for iOS correctly, for Android this does not happen, so I must implement different solutions for each of the platforms, so I'm using the following implementation with pdf.js <a href="https://github.com/xamarin/recipes/tree/master/Recipes/xamarin-forms/Controls/display-pdf?fbclid=IwAR35oOt4ySm64begNPAlBTmPEUf-jnERqzHu8_ZDUdrdE_dyG9eqbYgUI2E" rel="nofollow noreferrer">recipes</a></p>
  
  <p>My app displays PDFs that are locally in the device, but it is not showing in the customized control, the first question I have is ... Can I pass the file path to the WebView so that I can visualize it? in the following way ...</p>
  
  <p><a href="https://i.stack.imgur.com/2MEa4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2MEa4.png" alt="path"></a></p>
  
  <p>the previous thing to bindar the property PDF to the customized control of the following form</p>
  
  <pre><code>  &lt;local:CustomWebView Uri="{Binding PDF}"
                               HorizontalOptions="FillAndExpand"
                               VerticalOptions="FillAndExpand" /&gt;
  </code></pre>
  
  <p>It is worth mentioning that introducing a PDF in the content folder of the Android project in the following way</p>
  
  <p><a href="https://i.stack.imgur.com/1TVWL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1TVWL.png" alt="Content"></a></p>
  
  <p>and then batch it in the following way in my XAML view, it works !!!     </p>
  
  <pre><code>   &lt;local:CustomWebView Uri="CV.pdf"
                               HorizontalOptions="FillAndExpand"
                               VerticalOptions="FillAndExpand" /&gt;
  </code></pre>
  
  <p>The way to pass the path to my PDF property from my ViewModel is the following ...</p>
  
  <p>ViewModel.CS:</p>
  
  <pre><code>  #region Constructor
          public VisorArchivosViewModel(Evidencia evidencia)
          {
              navigationService = new NavigationService();
  
              this.evidencia = evidencia;
  
              if (evidencia != null)
              {
                  PDF = evidencia.Path;
  
              }
  
          }
          #endregion
  </code></pre>
  
  <p>I know that my question is basic, but how can I show a PDF that is stored locally on my device in a WebView?</p>
  
  <p>ANY HELP FOR ME¿?</p>