public Stream DownloadPdfStream(string URL, string documentName)
{
var uri = new System.Uri(URL);
//Returns the PDF document stream from the given URL
return m_webClient.OpenRead(uri);
}
|
protected override void OnAppearing()
{
base.OnAppearing();
//Provide the PDF document URL in the below overload.
Stream documenStream = DependencyService.Get<IDownloader>().DownloadPdfStream(URL,"Sample");
//Loads the PDF document as Stream to PDF viewer control
pdfViewerControl.LoadDocument(documenStream);
pageCountLabel.Text = pdfViewerControl.PageCount.ToString();
}
|
<ContentPage.Content>
<syncfusion:SfPdfViewer x:Name="pdfViewer">
</syncfusion:SfPdfViewer>
</ContentPage.Content>
|
Hello,
I was able to build the sample project referred to above, but when I try to run it in the iOS emulator (iOS 10.3) then it throws an exception with the following error.
2017-09-11 21:26:17.781 GettingStarted_PDFVieweriOS[54443:3987162] warning: Invalid type Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx for instance field Syncfusion.SfPdfViewer.XForms.iOS.SfPdfDocumentViewRenderer:scrollView
Can you help?
Thanks,
Thaine
I have implemented the URL stream loading mechanism as per the sample project you provided. However, it also fails under iOS with the same exception as the sample project. It's odd because I don't understand how changing the source of the data stream would affect the view renderer for SfPdf.
Please help!
Thanks,
Thaine
Thank you for the new sample! It does work. I noticed that it references Syncfusion version 15.3.0.29, whereas I was using 15.3.0.26. Apparently the bug was fixed in the new version. Thank you for looking into it.
Thaine