How to get path of the viewer

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

muralidhar
User
Posts: 46
Joined: Tue Nov 30, 2010 9:07 am

How to get path of the viewer

Post by muralidhar »

Hi all,

i am using PDFXChange Viewer activex in my asp.net web application.
i want to get path of the viewer, i mean if a pdf is opened in viewer file will be downloaded to my documents folder by default. i want to get that path in javascript.

how to get viewer path (ex: my documents)? this is an urgent requirement for me.

please suggest ASAP.
Regards,
Muralidhar.
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7361
Joined: Wed Mar 25, 2009 10:37 pm

Re: How to get path of the viewer

Post by Paul - PDF-XChange »

Hi muralidhar,

it's not clear to me if you want the Viewer path or the document path. I think you want the document path although you said:
i want to get path of the viewer
The default path to the Viewer is C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe

if a pdf is opened in viewer file will be downloaded to my documents folder by default.
If you are referring to where a PDF file is saved to when a web based PDF is clicked in a web browser then this is a function of the Browser not our Viewer and you will need to 'interrogate' your browsers setup to establish the folder - not the PDF-XChange Viewer.

Is that the situation here or have I missunderstood?
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
muralidhar
User
Posts: 46
Joined: Tue Nov 30, 2010 9:07 am

Re: How to get path of the viewer

Post by muralidhar »

Hi Paul,

Sorry if i am not clear.

i want to know the viewer's document path, where the documents are going to be downloaded.

Please suggest.
Regards,
Muralidhar.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: How to get path of the viewer

Post by Stefan - PDF-XChange »

Hello muralidhar,

Please have a look at the SaveAsDestLast and DownloadFolder objects inside the 2.2.2.4 Documents structure in our Viewer's AX Manual.

The first will contain the path to the last saved document's location, and the latter will have the folder for all downloaded documents. Used by e.g. the "Open from URL" feature.

There are also GetDocumentProperty and SetDocumentProperty methods you could use to obtain the needed information.

Best,
Stefan
muralidhar
User
Posts: 46
Joined: Tue Nov 30, 2010 9:07 am

Re: How to get path of the viewer

Post by muralidhar »

Hi Stefan,

thanks for your reply.

could you please provide an example to get "DownloadFolder" in javascript.

i tried with GetProperty, GetDocumentProperty and Property methods. But, i am unable to get the download path of viewer.

i am using document.all.PDFView.Property("Documents.DownloadFolder", 0); to get it. But, every time i am getting ""(empty string) as a result
and for
document.all.PDFView.GetProperty("Documents.DownloadFolder", 0) i am getting "undefined" as result

please suggest me asap.

this is very urgent requirement for me.
Regards,
Muralidhar.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: How to get path of the viewer

Post by Stefan - PDF-XChange »

Hello Muralidhar,

You should be using
document.all.PDFView.GetProperty("Documents.DownloadFolder", DataOut ,0) and the function will return as a result a string with your path needed.

Best,
Stefan
muralidhar
User
Posts: 46
Joined: Tue Nov 30, 2010 9:07 am

Re: How to get path of the viewer

Post by muralidhar »

Hi Stefan,

i wrote the statements as follows
var DataOut = "";
document.all.PDFView.GetProperty("Documents.DownloadFolder", DataOut, 0);

now i am getting "undefined" as result for the method and DataOut as ""(empty string)

is the syntax right or anything need to be changed?

please help me.
Regards,
Muralidhar.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: How to get path of the viewer

Post by Vasyl - PDF-XChange »

By default the property 'Documents.DownloadFolder' is empty - and in this case viewer uses the standard 'My Documents' from system.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
muralidhar
User
Posts: 46
Joined: Tue Nov 30, 2010 9:07 am

Re: How to get path of the viewer

Post by muralidhar »

Hi Stefan,

Thanks for your reply.

i just want to know how pdf xchange viewer is able to take "My Documents" folder path as default download path irrespective of the operating system?

I have tested my ASP.NET sample application with both windows XP and windows 7. in both operating systems it is taking the path correctly. in windows xp it will be "My Documents" and in windows 7 "Documents". How this is done?

actually i have to get my documents folder path client machine. i tried in so many ways but no luck. then i tried with pdfxchange viewer also and i am getting "" as result.

if you could please let me know how to get client systems "My Documents" folder path(this should work as same as for viewer control), that would be a great help for me.

please help me.
Regards,
Muralidhar.
Jamie - Tracker Supp
User
Posts: 191
Joined: Thu Jun 02, 2011 3:23 pm

Re: How to get path of the viewer

Post by Jamie - Tracker Supp »

Hi muralidhar,

You can use a windows registry key. HKCU\Software\Microsoft\Windows\Currentversion\Explorer\Shell Folders\Personal.

Regards,
Jamie.
muralidhar
User
Posts: 46
Joined: Tue Nov 30, 2010 9:07 am

Re: How to get path of the viewer

Post by muralidhar »

Hi Stefan,

Thanks, can we read that registry value from javascript.

Thanks,
murali.
Regards,
Muralidhar.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19883
Joined: Mon Jan 12, 2009 8:07 am

Re: How to get path of the viewer

Post by Stefan - PDF-XChange »

Hello Murali,

Here is some JS code that does this:
http://msdn.microsoft.com/en-us/library/x05fawxd
But please note that this is not JS you can use through our Viewer's AX - so I'd recommend you to obtain the registry value using your programming language's methods - and then just pass the needed path to our Viewer

Best,
Stefan