how to show pdf document on click

1895
4
06-14-2016 02:54 AM
SadanandacharB1
New Contributor III

Hi All,

          I have one spatial table with attributes information and pdf name stored in it. On map click i am displaying the attribute information information in datagridview using identify task in arcgis javascript.

My problem is along with attribute information i have to display pdf document related to that feature which is stored in a server folader. Please show me some examples to do this.

Thanks!

0 Kudos
4 Replies
FC_Basson
MVP Regular Contributor

If the location of the PDF document is known in any of the attributes of the features, you can simply open it in a new window/tab:

window.open(pdfUrl, "_blank");
0 Kudos
SadanandacharB1
New Contributor III

Thanks FC Basson

   Can you give me simple example for this, i am new to javascript, can you please help me

0 Kudos
FC_Basson
MVP Regular Contributor

That is the example.  You just need to replace pdfUrl with the actual URL location of the PDF document, e.g. "http://myserver.com/data/feature1.pdf" (absolute pathname) or "/data/feature1.pdf" (relative pathname).  Follow the API instructions to retrieve information from your features with the IdentifyTask (API 3.16: IdentifyTask | API Reference | ArcGIS API for JavaScript , API 4.0: IdentifyTask | API Reference | ArcGIS API for JavaScript 4.0 ).

SadanandacharB1
New Contributor III

Thank you so so so much

0 Kudos