Unable to view PDF in iOS


#1

I have the following codes which are used to display PDF file in a browser. It works fine on desktop in Chrome/IE, but not on iPad on iOS. I’m using Aspose.PDF for .NET 19.6.0 on iOS 13.2.2.

        string doc = "\\\\dev\\02246.pdf";
        Document pdf = new Document(doc);

        MemoryStream stream = new MemoryStream();
        pdf.Save(stream);
        Response.Clear();
        Response.AppendHeader("Pragma", "no-cache");
        Response.ContentType = "application/pdf";
        Response.AppendHeader("Content-Disposition", "inline; filename=FileName.pdf");
        Response.AddHeader("Content-Length", stream.Length.ToString());
        Response.AppendHeader("Connection", "close");
        Response.BinaryWrite(stream.ToArray());
        Context.ApplicationInstance.CompleteRequest();

#2

@steviepca

Thank you for contacting support.

Would you please try to load another PDF document created by MS Word or Adobe Acrobat etc. into the memory stream and then mention if the problem occurs with all PDF documnts or only with the documents generated by Aspose.PDF API., so that the problem may be narrowed down and investigated accordingly. Before sharing the information, please ensure using Aspose.PDF for .NET 19.10 in your environment.


#3

The PDF documents I’m using are not generated by Aspose.PDF API. Using Adobe Acrobat Pro, I’m able to view the PDF documents outside of my custom application. Unfortunately, I’m not able to upgrade to Aspose.PDF for .NET 19.10 since the version (19.6.0) is set by my company.


#4

@steviepca

The issue you are facing does not seem like related to Aspose.PDF. Would you please share a screenshot that shows what error occurs during PDF loading in chrome. Also, please try to save generated PDF in your mobile and open it in chrome and see if it is able to show it or not. Your feedback is awaited.