Copy link to clipboard
Copied
Hello,
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
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
Only if a "normal" forms submission
...Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Let's take a look at the submit options you have:
The same options that you see on the "Submit" dialog are also available via JavaScript.
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"):
<?php
$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.";
header('Content-Type: application/vnd.fdf');
echo("%FDF-1.2\n%âãÏÓ\n1 0 obj\n<<\n/FDF\n\t<<\n\t/Status(");
echo($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.
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
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
Only if a "normal" forms submission is not what you are looking for, should you invest time and money into investigating FDF/XFDF or complete PDF submission. I would stay away from FDF and use XFDF instead unless you need specific features of FDF that are not implemented in XFDF (e.g. annotations or JavaScript). XFDF has the advantage that it's a "modern" XML based format and therefore much easier to parse.
To report status back to the PDF form, you always need to use FDF however.
Copy link to clipboard
Copied
Duh...Thank You. I was initially directed to Web Services
Went with just the regular HTML Request and it works fine.
Copy link to clipboard
Copied
Thank you for this piece...it solved another issue with Reader I was having.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Actually, nevermind. I re-read your solution and it may work for me. Thank you