How to display pdf in browser from database using Xamarin and SQL Server RRS feed

  • Question

  • I have a listview in Xamarin form, which you can see in the screenshot here:


    and this is my database structure


    as you can see in database i have file content which is in binary format and these binary data are pdf files, i need to display these pdf in browser.

    In my listview, I am retrieving data with button, what i want is  when the user clicks on button, a PDF file should open in browser from the database based on id.

    This is my xaml code

                    <StackLayout Orientation="Vertical" Padding="12,6">
                        <Label Text="{Binding ReportName}" 
                               Style="{DynamicResource ListItemTextStyle}" />
                        <Label Text="{Binding Date}"  
                               Style="{DynamicResource ListItemDetailTextStyle}"/>
                          <Button Clicked="ShowPDF" Text="View" CommandParameter="{Binding FileContent}"></Button>

      [1]: https://i.stack.imgur.com/1gTv6.png
      [2]: https://i.stack.imgur.com/8GHFc.png


        protected void ShowPDF(object sender, EventArgs args)
                    Button button = (Button)sender;
                    string path = button.CommandParameter.ToString();
                    Navigation.PushAsync(new PDFView(path));
    • Moved by CoolDadTx Monday, April 16, 2018 2:25 PM Not C# related
    Monday, April 16, 2018 10:33 AM

All replies

  • These forums are for C#-specific questions only. Please post questions related to UI technologies like Xamarin in the appropriate forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Monday, April 16, 2018 2:25 PM