Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

submitForm ability to construct cURL based on pdf in broswer?

Avatar

Former Community Member
Hey all,<br /><br />Newbie alert. I've spent some time perusing the forums and web and every example I see around submitting pdf forms to an http event.target are ALL full path urls. Sorry if this is an obvious one. <br /><br />Here is my deal. Trying to construct a single fillable pdf with a http submit button. And the pdf is embedded within the browser (<embed src=...), in our web app. Then DEPENDING on the environment (localhost, test, staging, production) the submit button within the pdf sends the whole pdf (cSubmitAs: PDF) to the server/http url. <br /><br />Otherwise, if we want to test in our environments, we'll have to create multiple pdf's with the same content, but different submit cURL's in them that point at the particular environment.<br /><br />For example, our environment target urls might be:<br /> local dev: http://localhost:8080/coolapp/pdfForm/save<br /> test: http://test.greatcompany.com/coolapp/pdfForm/save<br /> prod: http://www.greatcompany.com/coolapp/pdfForm/save<br /><br />Is there a way to pick off the base url from the form that is under use/edit and then have some javascript build a full http url? So given the examples, the javascript is able to pick off http://test.greatcompany.com or http://localhost:8080 somehow from the context of the pdf being presented within the browser? Then it would just be a matter of using that dynamic base url and tacking on the '/coolapp/pdfForm/save'. Or is there no such metadata/object that has that information? And I just have to punt and create multiple forms with different full path cURL's?<br /><br />thanks for reading,<br />chad.
2 Replies

Avatar

Former Community Member
I've experimented with Howard from http://www.pdfformcentral.com/ and if you
or
inline your pdf in your html or view the pdf within a browser using a pdf browser plugin, you can use a relative path to your application on the submitForm javascript in combination with this.baseURL in the javascript. In the example above, you can use this.baseURL + /coolapp/pdfForm/save.



thanks,

chad.

Avatar

Level 2

Hi Chad,

Would you be able to point me to the right direction?

I am trying to find a way to submit a user-filled PDF, through Adobe Reader, that is embedded on an aspx to our webserver much like yours.  I have added a JavaScript in my PDF http post submit button that submits to a specific URL (http://localhost/WebApp/WebFolder/) as PDF but it doesn't seem to work.  I constantly get a "The HTTP verb POST used to access path '/PermitWeb/FileServer/' is not allowed." error. Please help.  Thanks.