I am working on a proof of concept to be able to send a PDF to a web service, I am running into a roadblock as to what it is sending and how the Web Service should be receiving the data.
I read conflicting documents as to what Adobe sends. Some say it is SOAP, some say HTTP, some say you need LifeCycle, some say you don't. I have what I think is a valid Web Service(ASP.NET & C#) but after several attempts and variations the button returns an error in Adobe and no actions seem to be performed(I am trying to get it to write the file to the Server). I've done web services in the past, but this is the first one I am doing where the sender is really a "black box" as to what it sends.
I have basically been beating my head against the wall for a couple of days and I am really looking for an example(or even at this point a small snipit) of what the code I need for the C# side of the Web Service to accept the request. Any links to additional sources would be appreciated as well. I think after that I could continue with my actions. At this point I just want to see something get to the service without returning an error, whether it is the PDF, an XML file...anything.
Thank you in Advance
Acrobat might connect with SOAP, with HTTP; might send HTML form format, XML or PDF or FDF or XFDF. It depends what you do, what type of form you have, what options you choose. It isn't random. You get SOAP only if using methods documented as SOAP. Submit type methods will use the protocol in the URL.
(Note the product name carefully, or you won't find any useful information. It is LiveCycle, with a V not LifeCycle with an F. The LiveCycle product family includes design and server apps, and certainly changed everything.)
So, what API are you using and what options, specifically?
Also, why do you want to submit a PDF? There are times it is indispensible, but mostly you HAVE the original PDF and don't need it again. Most people want the form data, and getting the PDF makes that enormously more complex than submitting the form data directly.
Submitting the actual PDF is an "ask" by the powers that be. Going into this I understood that is a lot more complex. That would be the A+++ solution...but even getting just the form data would be enough for this first step.
Let's take a look at the submit options you have:
You can submit a form as FDF, XFDF, HTML and the whole PDF document.
When you select the "HTML" option., you end up with exactly the same submission process that a web form would use, so if you an receive data from a web from, you can receive data from a PDF document. In the case of FDF, XFDF and PDF, the submission is done in a slightly different way. I don't know how to do this in C#, but I can tell you that the data is submitted as raw data in the HTML request. In PHP you would get access to it via "php://input". The following snippet shows you how to take that raw data and save it to a file (in this case, it assumes that the upload is a PDF file, but in case of FDF or XFDF, you can parse the data you get in "php://input"):
$target_dir = "uploads/";
$target_file = $target_dir . "upload.pdf";
copy("php://input", $target_file); // this is where the magic happens
// report status back to Acrobat/Reader via FDF
$status = "File successfully uploaded.";
echo("%FDF-1.2\n%âãÏÓ\n1 0 obj\n<<\n/FDF\n\t<<\n\t/Status(");
echo("\t)>>\n>>\nendobj\ntrailer\n<</Root 1 0 R>>\n%%EOF");
This snippet also shows how to report status back to the Acrobat or Reader application. As you can see, there is no error checking here, so that's stuff that you would need to add to make this production quality code.
Thank you for the snipit.
Sorry for no screenshot but here is the following
The URL is http://mydomain/Webservice.asmx
Selecting XFDF Field and Comments. (Although at various times I have tried other options as well, so is FDF is the way to go)
However we are not a PHP shop and that really isn't going to be an option.
Would there be a similar example in ASP.NET to how it is received?
Again thank you for any help as this just seems to be sending me into a lot of confusion..
You don't use a web service for this, it's just a regular HTML request. And no, FDF is not necessarily the way to go. It is usually more straight forward to submit as HTML and then just deal with what looks like a submission form a normal web form. From that point on, you are no longer dealing with anything that is specific to Adobe Acrobat. Take a look for example at this tutorial: Working with HTML Forms in ASP.NET Web Pages (Razor) Sites | The ASP.NET Site
To report status back to the PDF form, you always need to use FDF however.
Duh...Thank You. I was initially directed to Web Services
Went with just the regular HTML Request and it works fine.
Thank you for this piece...it solved another issue with Reader I was having.
Is there a solution for the PDF 'The complete document' option? I'm posting to a API and am capturing what appears to be a byte array, but when I write it to a file, Adobe is unable to open it.
I need to post the entire PDF as it's an inspection sheet and requires a signature, so posting HTML won't fit the bill in this case.
Any direction you can provide would be greatly appreciated.
Actually, nevermind. I re-read your solution and it may work for me. Thank you