Select to view content in your preferred language

AlivePDF - result displays request instead of Title of PDF

864
5
06-15-2010 06:54 AM
CarmenDurham
Frequent Contributor
Hello all,

I am using AlivePDF and have the resulting document displaying the content with no problems.

But the tab in IE displays:  "http://myserver/createPDF/create.aspx?name=AddressReport.pdf&method=inline"
instead of something like Address Report.

What/where can I change it so that the tab will read "Address Report" or AddressReport.pdf?  Also, when I try a "file/Save As", it wants to save the file to "create.pdf" instead of "AddressReport.pdf"

Any ideas?  I tried a couple of things in the .mxml (.setTitle for the PDF) and in the createPDF app folder, but they didn't work. 

Thanks,
Carmen
Tags (2)
0 Kudos
5 Replies
LeonScott
Deactivated User
Carmen,

In your .aspx page, you can put this line of code in the Page_Load function...


Page.Title = "Address Report"

to change the tab in IE. This worked for me.

I noticed the default name of the pdf will be the same as the name of your .aspx page. Mine has a default name of "default". So you could rename your page to AddressReport.aspx, as a work around. I haven't figured out another way to do that.


Leon
0 Kudos
CarmenDurham
Frequent Contributor
Leon,

Thank you for responding. 

I renamed the .aspx and aspx.cs so that at least the "save as" works a little better per your suggestion.

I have added Page.Title = "Address Results" to the Page_Load event, but it still doesn't work.  I tried various locations.  Here is what my page_load event looks like.  Will you please compare it with yours?  I have even tried setting name="Address Results". 

Also, what version of AlivePdf are you using?  I have 1.4.9.

   protected void Page_Load(object sender, EventArgs e)
    {
                Page.Title = "Address Search";
                string method = Request.QueryString["method"];
     string name = Request.QueryString["name"];
    
     byte[] data = Request.BinaryRead(Request.TotalBytes);
    
     Response.ContentType = "application/pdf";
     Response.AddHeader("Content-Length", data.Length.ToString());
     Response.AddHeader("Content-disposition", method + "; filename=" + name);
     Response.BinaryWrite(data);
     Response.End();
    }
}


I know very little about asp.net so if I am missing something obvious, I apologize.

Thanks,
Carmen
0 Kudos
LeonScott
Deactivated User
Hi Carmen,

You're not missing anything obvious...  This acted a little quirky when I made the change.  I guess it wasn't just me.  The change to the page title didn't seem to want to take for me either, as I thought it should.  I found this worked.....  Comment everything out except your Page.Title = "Address Search" line and recompile.  Test it out to see if the IE tab changed like you would expect.  Then go back uncomment your code and recompile again.  I know its weird, but I stumbled upon this and it did the trick.


Leon
0 Kudos
CarmenDurham
Frequent Contributor
Leon,

That's funny because, yesterday, I did try part of what you said (commenting out everything and seeing if I just got a blank page with the real name I wanted) and it did work.  I'll try actually recompiling in VS and placing it back on the server and seeing if that works.

I guess there is some comfort (??) in knowing the quirks are not just me.

Thanks,
Carmen
0 Kudos
ZhujingXia
Frequent Contributor
Hi,
I am new to this thread. I used alive PDF in flex API 1.3. Now I need to upgrade to flex api 2.4. Do you know this alive PDF would work with flex api 2.4 or not?

Thanks

Zhujing
Zhujingx@co.rockland.ny.us
0 Kudos