Receiving "Could not find valid signature (PDF-)." when opening my PDF

Hi,

I'm having a problem with loading a PDF in my xamarin android app.
It throws this exception: "Could not find valid signature (PDF-).".
I am able to open my PDF in the native PDF viewer.
I have tried your sample PDF which is displayed just fine.


Hope you can help.

- Martin

private async void LoadPdf(string url)
{
pdfViewGrid.IsVisible = true;
var stream = await DownloadPdfStream(url);
stream.Position = 0;
pdfViewerControl.InputFileStream = stream;
}

private async Task DownloadPdfStream(string URL)
{
HttpClient httpClient = new HttpClient();
HttpResponseMessage response = await httpClient.GetAsync(URL);
//Check whether redirection is needed
if ((int)response.StatusCode == 302)
{
//The URL to redirect is in the header location of the response message
HttpResponseMessage redirectedResponse = await httpClient.GetAsync(response.Headers.Location.AbsoluteUri);
return await redirectedResponse.Content.ReadAsStreamAsync();
}
return await response.Content.ReadAsStreamAsync();
}

Attachment: STYK300007_a13b8fc6.rar

1 Reply 1 reply marked as answer

MK Muralitharan Karikalan Syncfusion Team March 15, 2021 04:35 PM UTC

Hi Martin, 
 
Greeting from Syncfusion support, 
 
We are still unable to reproduce the issue, “Application throws exception while loading a particular PDF document” with the details you have provided. Could you please try the below sample and let us know whether we have missed out anything while replicating the issue. 
 
Please find sample we have tried to reproduce the issue in our end, 
 
Kindly provided us the following details to analyze further more on this issue, 
1.Simple sample or modify the above sample  
2.replication procedure/ video 
3.Stack trace 
 
Regards, 
Muralitharan K 


Marked as answer
Loader.
Up arrow icon