some quesitons about Viewer SDK

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

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Jin Lin
User
Posts: 2
Joined: Sat Jun 06, 2015 4:44 am

some quesitons about Viewer SDK

Post by Jin Lin »

Hi,tacker support

I have three questions about Viewer SDK, hope you can provide some useful suggestion to me. :D

1、(About stamp)
I want to make a annotation as stamp just like this(Please check the file at the attachment), is there any way to do it through code via the SDK?
,
2、(About customize Viewer UI)
I cannot remove unnecessary items from menu, Does it have anything to do with licence?

3、(About toolbars visible)
I try to make some toolbars visible, some of operations were successful(example View.Bars[\"Menu\"].Visible), the other were failed(example View.Bars[\"PagesNavigation\"].Visible, View.Panes[\"Thumbnails\"].Visible and Bookmarks), What's the problem here?

Look forward to your reply!

if possible,Reply in c\c++ code please!

Regards,

Jin
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: some quesitons about Viewer SDK

Post by Vasyl-Tracker Dev Team »

Hi Jin.
1、(About stamp)
I want to make a annotation as stamp just like this(Please check the file at the attachment), is there any way to do it through code via the SDK?
You may add text-box annot by running the JavaScript. For example:

Code: Select all

string js = "
var annot = this.addAnnot
({
  page: 0,
  rect: [200, 280, 420, 300],
  type: "FreeText",
  contents: "Please check the file at the attachment.",
});
if (annot != null)
    annot.readOnly = true;"

pdfViewer.RunJavaScript(js);
2、(About customize Viewer UI)
I cannot remove unnecessary items from menu, Does it have anything to do with licence?
You may do it in next way:
1. launch the app with embedded pdf-control. Like end-user use the Customize Toolbars feature (right-click on any toolbar, select "Customize..." item) and build your own toolbars content.
2. next - use the "Menu/Edit/Export All Settings" feature and save all existing settings (including new toolbars layout) into a file (look also to FullDemo example from our SDK examples, tab "I/O Settings").
3. next - on each start of your app - call pdfViewer.LoadSettings(settingsFileName);
3、(About toolbars visible)
I try to make some toolbars visible, some of operations were successful(example View.Bars[\"Menu\"].Visible), the other were failed(example View.Bars[\"PagesNavigation\"].Visible, View.Panes[\"Thumbnails\"].Visible and Bookmarks), What's the problem here?
Use the correct way:

Code: Select all

pdfViewer.SetDocumentProperty(docIdOrZeroForSDI, "View.Bars[\"<Name>\"].Visible", val);
HTH
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Jin Lin
User
Posts: 2
Joined: Sat Jun 06, 2015 4:44 am

Re: some quesitons about Viewer SDK

Post by Jin Lin »

Hi Vasyl,

I am sorry that these questions were not clearly explained. I have reattached the three questions. Would you please kindly review the questions and provide me with clearly instructions. Thank you.
You may add text-box annot by running the JavaScript. For example:
The stamp what i mean is not a text, instead it was a style as attachment.
The form of the stmap is circle , the center is a star,text floats on the circumference, with the characteristics of China
I'm sure that the attachment was added successfully by a zip format, but it isn't posted on the article,now make up.
You may do it in next way:
1. launch the app with embedded pdf-control. Like end-user use the Customize Toolbars feature (right-click on any toolbar, select "Customize..." item) and build your own toolbars content.
2. next - use the "Menu/Edit/Export All Settings" feature and save all existing settings (including new toolbars layout) into a file (look also to FullDemo example from our SDK examples, tab "I/O Settings").
3. next - on each start of your app - call pdfViewer.LoadSettings(settingsFileName);
I know these steps,now the question is coming,i can’t drag the command item from commands list.
This means that i can't drop some items from a menu or toolbar,the only one that seem to support is visable\unvisable toolbars?
How can i drop some items from a menu through the Customize Toolbars dialog?
pdfViewer.SetDocumentProperty(docIdOrZeroForSDI, "View.Bars[\"<Name>\"].Visible", val);
Thank you for the correct method,and then i the have the other problem,how to show the thumbnails at the first time when open a new document?
Can you provide the example by the c++ code please!


jin
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: some quesitons about Viewer SDK

Post by Vasyl-Tracker Dev Team »

The stamp what i mean is not a text, instead it was a style as attachment.
Exists one way to add stamp with any shape. Firtstly you must prepare your own stamp-collection. Use end-user viewer for that (Stamp Palette, add new stamp using "From PDF..." feature to keep vector-image). Then look to newly create file in
"C:\Users\<UserName>\AppData\Roaming\Tracker Software\PDF-XChange Viewer\2.0\Stamps\<GuidOfNewCollection>.pdf"
open this file an look for:

<<
/Names [(<GuidOfStamp1>=<Stamp1DispName>) ... (<GuidOfStamp2>=<Stamp2DispName>) ...]
>>

and the you will be able to use js for adding of necessary stamps from your collection:
var aa = this.addAnnot({type: "Stamp", page: 0, rect: [0, 0, 300, 300], AP: "<GuidOfStamp>"});
I know these steps,now the question is coming,i can’t drag the command item from commands list.
Strange. It should be too easy.. For example, launch the Viewer end-user app. and show the "Customize Toolbars..." dialog. Then select "Commands" tab. There you should be able to drag any command item from list on to any existing toolbar and drop it. When you moving over toolbar/menu it shows special orange drop-mark to indicate position of insert.. It looks different for you?
how to show the thumbnails at the first time when open a new document?
Sure:

Code: Select all

CComBSTR str;
str = L"View.Panes[\"";
str.Append(L"Thumbnails"); // "Bookmarks", "Comments", "Attachments"...
str.Append(L"\"].Visible");
CComVariant val(true); 
pdfViewer->SetDocumentProperty(docIdOrZeroForSDI, str, val);
HTH
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.