cancel
Showing results for 
Search instead for 
Did you mean: 

BO XI R3.1 SP7 on W2012R2 : File does not begin with '%PDF-' error

Former Member
0 Kudos

Hello,

A customer of ours has been using a .NET aspx page in IIS for several years now, which does the following :

  • Log on to a BO XI R3.1 server
  • Find the mentioned report
  • Perform a refresh (with the eventual prompts filled out)
  • Stream the result as a PDF to the browser

Basically, this RunWebReport aspx can be called as follows :

http://myserver/RunWebReport/default.aspx?FileName=MyReportName

We recently installed a new BO XI R3.1 SP7 server on a Windows Server 2012 R2 machine,

and since that moment, we have an issue with the PDF stream.

We tried different browsers (IExplorer, FireFox, Chrome, all different versions) and different PDF plugins (Adobe, FoxIt, PDFViewer).

They all give back the same type of errors :

  • Failed to load PDF document
  • File does not begin with '%PDF-'
  • The PDF document might not be correctly displayed

In some cases, you can then download the stream to an actual local PDF file, but when opening this file with Acrobat, you get the error that the file might be damaged.

So, it seems the stream is recognized as a PDF allright, but the content does not seem to be ok.

When downloading the "corrupt" PDF, I see that the size is much smaller than it normally should be.

When we open the same report in a InfoView session, and download it as a PDF manually, this works fine.

The application runs through all the steps just fine, and does not generate any error.

It's just that the stream is not ok in the end.

Here's the function which finally streams to the browser.

Does anyone see something which might be missing here ?

Or could it be an IIS 8 issue ?

Thanks !

Bruno.


    Private Function VisualizeReport(ByRef MyDocView As IBinaryView, _

                                   ByRef MyDoc As IDocumentInstance) As Boolean

        Dim gLog As ILog = log4net.LogManager.GetLogger("VisualizeReport")

        VisualizeReport = False

        Try

            MyDocView = MyDoc.GetView(OutputFormatType.Pdf)

            gLog.Debug("DocView set ...")

            Response.ClearContent()

            Response.ClearHeaders()

            Response.ContentType = "application/pdf"

            Response.AddHeader("Content-Type", "application/pdf")

            Response.AddHeader("Content-Length", MyDocView.ContentLength.ToString)

            Response.Expires = 0

            MyDocView.WriteContent(Response.OutputStream)

            Response.Flush()

            Response.Close()

            gLog.Debug("OutputStream written ...")

            VisualizeReport = True

        Catch ex As Exception

            gLog.Error("Error during report visualization : " + ex.Message)

            VisualizeReport = False

        End Try

    End Function

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Bruno,

MS changed a bunch of security settings in 2012 Server. Check the permission on the IIS \temp folder. When BOE SDK Exports it first tries to write the file to disk and then delete it to validate if it has full read/write permissions.

Since you are seeing a "~" in the name it means it tried to write a temp file and then failed due to permissions. Normally you would see the full file name as you normally do, with no tilde in the name.

If it has rights then check your AV and Firewall software settings, it could be blocking access...

Don