- Sep 14, 2009 The content types 'application/pdf' and 'application/msword' should work, assuming that the content you're sending is correct. What do you mean by 'nothing happens'?
- The information in the ContentType class is used to describe the data contained in an email message in such a way that software that displays email can present the content in an appropriate manner. ContentType is used with the Attachment class to specify the type of content in the attachment.
- Just send back a Content-Type header of “application/pdf” and an empty body. If the header exists, then the request came from the PDF viewer and you can send your PDF back normally. Basically, the handler treats that first request as a HEAD request and then responds with the full PDF if we determine that the request is coming from the PDF.
- Its browser issue if u run this code in IE only it will show open or save option in google chrome it will not show.
- While, this brought up the pdf, I'm still needing a way to save the merged pdf instead of the xml. What I'm thinking is, the response object on the server is 'not' going to have the information it needs to save the pdf document since the pdf is created by adobe on the fly rather than the pdf being a file on the server that can be downloaded.
仕事でやったことを問題ない範囲で気ままに上げていきます web系多し.
Here is the code in ASP and then below in C#:<%
Response.ContentType = 'application/vnd.adobe.xdp+xml'
Response.Write('<?xml version='1.0' encoding='UTF-8'?><?xfa generator='AdobeDesigner_V7.0' APIVersion='2.2.4333.0'?><xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'><xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'><xfa:data><form1><TextField1>aaaaaaaa</TextField1></form1></xfa:data></xfa:datasets><pdf href='http://localhost/test/test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' /></xdp:xdp>')
%>
Here's the same code in C#
StringBuilder responseString = new StringBuilder();
Response.ContentType = 'application/vnd.adobe.xdp+xml';
responseString.Append('<?xml version='1.0' encoding='UTF-8'?>');
responseString.Append('<?xfa generator='AdobeDesigner_V7.0' APIVersion='2.2.4333.0'?>');
responseString.Append('<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>');
responseString.Append('<xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'>');
responseString.Append('<xfa:data>');
responseString.Append('<form1>');
responseString.Append('<TextField1>aaaaaaaa</TextField1>');
responseString.Append('</form1>');
responseString.Append('</xfa:data>');
responseString.Append('</xfa:datasets>');
responseString.Append('<pdf href='http://localhost/test/test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />');
responseString.Append('</xdp:xdp>');
Response.Write(responseString);
Job Application Pdf
Response.Flush();Response.End();
I'm using ASP.Net, C#. Any ideas?