From: Mangler on
I am using the USPS Electronic Return Merchandise API to print labels
on the web and am at the last point to get this to work, obviously Im
stuck now.

The response from the USPS server is an encoded base64 string that you
need to decode before being able to use things, I was able to decode
it no problems. Used a component from XStandard to do so.

I am unsure what to do from here to get the decoded string to open the
pdf file in the browser.

I have been able to get a csv file in the past to open like I want the
pdf but it is not working, the decoded string shows on the page and
not an actual pdf file.

Here is my code :

<%
Dim objBase64, strImage
Const otSafeArray = 0
Const otString = 2
strImage = "ENCODED_STRING"
Set objBase64 = Server.CreateObject("XStandard.Base64")
Response.ContentType = "application/pdf"
Response.AddHeader "content-disposition", "attachment;
filename=test.pdf"
Response.BinaryWrite objBase64.Decode(strImage, otSafeArray)
Set objBase64 = Nothing
%>


what am I doing wrong?
From: Evertjan. on
Mangler wrote on 11 jan 2010 in microsoft.public.inetserver.asp.general:

> I am using the USPS Electronic Return Merchandise API to print labels
> on the web and am at the last point to get this to work, obviously Im
> stuck now.
>
> The response from the USPS server is an encoded base64 string that you
> need to decode before being able to use things, I was able to decode
> it no problems. Used a component from XStandard to do so.
>
> I am unsure what to do from here to get the decoded string to open the
> pdf file in the browser.
>
> I have been able to get a csv file in the past to open like I want the
> pdf but it is not working, the decoded string shows on the page and
> not an actual pdf file.
>
> Here is my code :
>
> <%
> Dim objBase64, strImage
> Const otSafeArray = 0
> Const otString = 2
> strImage = "ENCODED_STRING"
> Set objBase64 = Server.CreateObject("XStandard.Base64")
> Response.ContentType = "application/pdf"
> Response.AddHeader "content-disposition", "attachment;
> filename=test.pdf"
> Response.BinaryWrite objBase64.Decode(strImage, otSafeArray)
> Set objBase64 = Nothing
> %>
>
>
> what am I doing wrong?
>

Will this help?

<http://geekswithblogs.net/Lance/archive/2007/07/18/Shipping-APIs-
FedEx.aspx>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Mangler on
On Jan 11, 5:00 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote:
> Mangler wrote on 11 jan 2010 in microsoft.public.inetserver.asp.general:
>
>
>
>
>
> > I am using the USPS Electronic Return Merchandise API to print labels
> > on the web and am at the last point to get this to work, obviously Im
> > stuck now.
>
> > The response from the USPS server is an encoded base64 string that you
> > need to decode before being able to use things, I was able to decode
> > it no problems.  Used a component from XStandard to do so.
>
> > I am unsure what to do from here to get the decoded string to open the
> > pdf file in the browser.
>
> > I have been able to get a csv file in the past to open like I want the
> > pdf but it is not working, the decoded string shows on the page and
> > not an actual pdf file.
>
> > Here is my code :
>
> > <%
> > Dim objBase64, strImage
> > Const otSafeArray = 0
> > Const otString = 2
> > strImage = "ENCODED_STRING"
> > Set objBase64 = Server.CreateObject("XStandard.Base64")
> > Response.ContentType = "application/pdf"
> > Response.AddHeader "content-disposition", "attachment;
> > filename=test.pdf"
> > Response.BinaryWrite objBase64.Decode(strImage, otSafeArray)
> > Set objBase64 = Nothing
> > %>
>
> > what am I doing wrong?
>
> Will this help?
>
> <http://geekswithblogs.net/Lance/archive/2007/07/18/Shipping-APIs-
> FedEx.aspx>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)- Hide quoted text -
>
> - Show quoted text -

I have seen that but it did not help much.
From: Bob Barrows on
Mangler wrote:
> I am using the USPS Electronic Return Merchandise API to print labels
> on the web and am at the last point to get this to work, obviously Im
> stuck now.
>
> The response from the USPS server is an encoded base64 string that you
> need to decode before being able to use things, I was able to decode
> it no problems. Used a component from XStandard to do so.
>
> I am unsure what to do from here to get the decoded string to open the
> pdf file in the browser.
>
> I have been able to get a csv file in the past to open like I want the
> pdf but it is not working, the decoded string shows on the page and
> not an actual pdf file.
>
> Here is my code :
>
> <%
> Dim objBase64, strImage
> Const otSafeArray = 0
> Const otString = 2
> strImage = "ENCODED_STRING"
> Set objBase64 = Server.CreateObject("XStandard.Base64")
> Response.ContentType = "application/pdf"
> Response.AddHeader "content-disposition", "attachment;
> filename=test.pdf"
> Response.BinaryWrite objBase64.Decode(strImage, otSafeArray)
> Set objBase64 = Nothing
> %>
>
>
> what am I doing wrong?

I'm not entirely sure, but I believe you need a component from Adobe to
generate a pdf that can be streamed to a client.

--
HTH,
Bob Barrows


From: Evertjan. on
Bob Barrows wrote on 11 jan 2010 in
microsoft.public.inetserver.asp.general:

> I'm not entirely sure, but I believe you need a component from Adobe to
> generate a pdf that can be streamed to a client.

or Persits AspPdf:

<http://www.asppdf.com/>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)