Viewer customisation

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

joeitaliano
User
Posts: 89
Joined: Wed Dec 29, 2010 8:50 am

Viewer customisation

Post by joeitaliano »

hello

i am new to this forum

first let me say great product

we are evaluating the xchange viewer sdk to look at the possibility of using it as our standard reader from process legal document.

to keep it simple for our clients we would like to customise the menu so that some of the functionality is slightly different

for example

1 - when the user select "open" we would like a predefined list of documents that he can select to appear
2 - when the document is opened it performs a mail merge by reading a text file that has the form filed names and the data and merges it.
3 - when the document is saved it can place the saved document under program control.

so my question is really what can be configured and could we pay tracker to do some changes for us

PS - we have looked at the simple sdk but this does not allow the forms to be edited. it only acts as a viewer. if it could edit the form then we could use this SDK. again can we pay to have the edit feature included.

thanks
joe@csolutions.com.au
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Viewer customisation

Post by Vasyl - PDF-XChange »

Hi, joeitaliano.
1 - when the user select "open" we would like a predefined list of documents that he can select to appear
There is no this feature now. But you can implement your own UI for selecting predefined documents and pass to our control the full_file_name/URL/stream_object of selected document.
In this case, you must disable our "Open" ui-command and, if you want to use our menu/toolbars, remove it from our menu/toolbars by:
1. remove our "Open" from UI:
a) use "Customize Toolbars..." EU-feature and remove "Open" fro all toolbars, menus
b) use "Menu/Edit/Save All Settings" feature for save custom settings to an external *.dat file
Note: for a), b) you may use our ActiveX SDK FullDemo example.
c) use ctrl.LoadSetting(<custom_settings.dat>) at each start of your program for load all your custom settings.
2. disable "Open":
ctrl.SetProperty("Commands["Open"].State", "Offline", 0);
2 - when the document is opened it performs a mail merge by reading a text file that has the form filed names and the data and merges it.
Yes. You may import programatically the external form data into the opened document by running special JavaScript for the opened document (pseudocode):

Code: Select all

string srcPath;
...
string js = "this.ImportAnFDF(" + srcPath + ");";
// string js = "this.ImportAnXFDF(" + srcPath + ");";
// string js = "this.importTextData(" + srcPath + ");";
ctrl.RunJavaScript(js, NULL, 0, 0);
- for details about this look to our ActiveX SDK help file, [Reference/JavaScript Support]
3 - when the document is saved it can place the saved document under program control.
1. You may pass your document as stream object for read/write operations.
Look to "OpenDocumentFromStream" example and to [Reference/Named Items/Simple Operations/OpenDocument].
To enable the saving to your original stream object you should call:

Code: Select all

ctrl.SetProperty("Document.UseStreamsDirectly", "true", 0);
or 2. You may pass full name of simple local file to our control for read/write operations.
In this case you should watch changes of this file... There is no "Document Saved" event. We will add this event in the near future, may be into the next build (upcoming).
PS - we have looked at the simple sdk but this does not allow the forms to be edited.
Sure, the our Simple SDK can be used for drawing/printing only.
You should use PDF-XChange Viewer ActiveX SDK for form filling and any interactions...

HTH.
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.
joeitaliano
User
Posts: 89
Joined: Wed Dec 29, 2010 8:50 am

Re: Viewer customisation

Post by joeitaliano »

thank you for the reply

do i need to write some javascrpt code to extract the form field values and update with the new values or can i use some c++ SDK functions.

if i can do it in c++ it is better. do you have some c++ code or instruction how i should do this

thanks again

joe
joe@csolutions.com.au
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19864
Joined: Mon Jan 12, 2009 8:07 am

Re: Viewer customisation

Post by Stefan - PDF-XChange »

Hello Joe,

I believe Vasyl answered your last question in this topic.

Have a lovely new year!
Stefan
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Viewer customisation

Post by Vasyl - PDF-XChange »

Hi, joe.

For import export form data you should pass special Java Script code to c++(COM) method:

Code: Select all

// import
BSTR js = SysAllocString(L"this.ImportAnFDF(<deviceIndependedPathToFileWithFormData>)");
pPDFViewer->RunJavaScript(js, NULL, 0, 0);
SysFreeString(js);

Code: Select all

// export
BSTR js = SysAllocString(L"this.exportAsFDF(true, true, "<deviceIndependedPathToDestFileWithFormData>", true);");
pPDFViewer->RunJavaScript(js, NULL, 0, 0);
SysFreeString(js);
There is no other way for this. Wait to V3 for full support of c++...

Best
Regards.
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.