Thumbnail Print Button

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

nlopes
User
Posts: 33
Joined: Tue Aug 24, 2010 3:44 am

Thumbnail Print Button

Post by nlopes »

Hello,

I'm testing out the PDF-XChange Viewer SDK and so far it's doing everything exactly like I want and I seem to have great control over many of the options. But I have a few questions I'm hoping someone may please help me with as I can't seem to find them (or examples) in the documentation:

I'm showing a quick preview window to the user with simply the thumbnails and the larger page view (of thumbnail selected). All toolbars, menu, etc.. are hidden. I'm using my own mini toolbar for just certain actions.

1). In the thumbnail window there are a few icons. Some to enlarge and reduce the thumbnail size (which are fine) and one to print. Can I disable or hide this print button in the thumbnail pane? Is there some DoVerb command that can change the state of this?

2). When I right click on the thumbnail, I get a large context menu with many options. I want to hide/disable many of those. I only want the user to be able to delete pages (not insert). Is there a way to do this to the context menu? I don't want to disable the context menu, just certain options.

3). When the user hits the save button in my toolbar, I call the Save method of the Viewer control. However, when I deleted pages or moved pages around in the thumbnail view, to re-order the PDF pages, I get a warning/confirmation window telling me the document was modified and confirm to save. Can I bypass this?

4). I notice that some windows have a check box that states "don't ask me this again". For example when I moved pages around in the thumbnail view. Is there a way to bypass this as well or have those present to "don't ask"? If it is selected, where is that setting stored? Do I need to export the Viewer settings and re-load them on next use so those responses stay consistent?

Thank you very much for your help and prompt reply,

Nelson
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Thumbnail Print Button

Post by Vasyl - PDF-XChange »

Hi, Nelson.
1). In the thumbnail window there are a few icons. Some to enlarge and reduce the thumbnail size (which are fine) and one to print. Can I disable or hide this print button in the thumbnail pane? Is there some DoVerb command that can change the state of this?
It's possible, you may disable the printing feature by:
ax.SetProperty("General.DenyAllPrintOperations", "true", 0);
or by switch off the UI-command for printing:
ax.SetProperty("Commands["Print"].State", "offline", 0);
2). When I right click on the thumbnail, I get a large context menu with many options. I want to hide/disable many of those. I only want the user to be able to delete pages (not insert). Is there a way to do this to the context menu? I don't want to disable the context menu, just certain options.
You may disable unnecessary commands by:
--
ax.SetProperty("Commands["InsertPages"].State", "offline", 0);
ax.SetProperty("Commands["InsertEmptyPages"].State", "offline", 0);
ax.SetProperty("Commands["ExtractPages"].State", "offline", 0);
ax.SetProperty("Commands["ReplacePages"].State", "offline", 0);
ax.SetProperty("Commands["DeletePages"].State", "offline", 0);
--
ax.SetProperty("Commands["RotatePages"].State", "offline", 0);
ax.SetProperty("Commands["CropPages"].State", "offline", 0);
ax.SetProperty("Commands["SetTransitions"].State", "offline", 0);
--
ax.SetProperty("Commands["Print"].State", "offline", 0);
ax.SetProperty("Commands["ExportToImage"].State", "offline", 0);
--
For more UI-commands, see the [Reference/Named Items/Objects/Commands/Commands List] section in the help file.
3). When the user hits the save button in my toolbar, I call the Save method of the Viewer control. However, when I deleted pages or moved pages around in the thumbnail view, to re-order the PDF pages, I get a warning/confirmation window telling me the document was modified and confirm to save. Can I bypass this?
Yes, you may bypass this by intercepting of special prompt-events (pseudocode):

Code: Select all

function OnEvent(Type, Name, ...)
{
    if (Type == PXCVA_OnDisplayPrompt)
    {
        if ((Name == "Prompts.ConfirmDocumentSave") OR (Name == "Prompts.ConfirmDocumentIncSave"))
        {
            // skip original dialog and close without confirmation and without saving
            ax.SetProperty(Name + ".UserChoice", "No", 0);
        }
    }
}
See also [Reference/Named Items/Objects/Prompts] section in the help.
4). I notice that some windows have a check box that states "don't ask me this again". For example when I moved pages around in the thumbnail view. Is there a way to bypass this as well or have those present to "don't ask"? If it is selected, where is that setting stored? Do I need to export the Viewer settings and re-load them on next use so those responses stay consistent?
Unfortunately, but these options are undocumented. Some existing:
"Prompt.ConfirmForDeletingPages", (simple boolean, default value is "true")
"Prompt.ConfirmForMovingPages", (simple boolean, default value is "true")
"Prompt.ConfirmForDeletingAnnots",(simple boolean, default value is "true")
"Prompt.ConfirmForDeletingBookmarks",(simple boolean, default value is "true")
"Prompt.ConfirmForDeletingActions",(simple boolean, default value is "true")
"Prompt.ConfirmForDeletingAttachments",(simple boolean, default value is "true")
"Prompt.ConfirmForDeletingRecents",(simple boolean, default value is "true")
"Prompt.RotatePagesViewWarn",(simple boolean, default value is "true")
"Prompt.ConfirmCloseAllDocuments",(simple boolean, default value is "true")
Example:
SetProperty("Prompt.ConfirmForMovingPages", "false", 0); // switch off the confirmation before moving pages
You may setup these options at each start of your program or you may setup the necessary values of options once,
save them by ax.SaveAllSettings routine and use each time at your program start by ax.LoadAllSettings.
In more cases both methods are identical, but SaveAllSettings/LoadAllSettings method can take some time.

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.
nlopes
User
Posts: 33
Joined: Tue Aug 24, 2010 3:44 am

Re: Thumbnail Print Button

Post by nlopes »

Wonderful! Thank you very much Vasyl. I'll look further into the documentation I have too (that was provided with the trial).

Best Regards,

Nelson
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Thumbnail Print Button

Post by John - Tracker Supp »

;-)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
nlopes
User
Posts: 33
Joined: Tue Aug 24, 2010 3:44 am

Re: Thumbnail Print Button

Post by nlopes »

John, I went ahead and purchased the PDF X-Change Pro SDK Bundle tonight (along with a 3yr upgrade plan) so I can start my final implementation of the PDF X-Change Viewer SDK into my application without the evaluation stuff. However, I have a couple of questions:

1). Regarding my previous question #2 above (disabling items in the right-click context menu), Vasyl's reply worked great and those features are now disabled. I was just wondering though is there a way to "hide" them instead of just disabling them? It would just make the menu shorter for the user and I'd prefer that if possible. I could not easily find that in the documentation and am still trying to get used to calling the DoVerb or SetProperty methods. For example, i tried to suppress moving/deleting of pages like this:

Call CoPDFXCview1.setProperty("Prompt.ConfirmForDeletingPages", 0)
Call CoPDFXCview1.setProperty("Commands[""Prompt""].ConfirmForDeletingPages", 0)
Call CoPDFXCview1.setProperty("Commands[""Prompt.ConfirmForDeletingPages""]", 0)
likewise for the moving pages:
Call CoPDFXCview1.setProperty("Prompt.ConfirmForMovingPages", 0)
...
and they all fail. Remember this is in VB6, thus the "" so I can get those in the required string being sent in.

2). I put in the key and dev code I received into the SetDevInfo method and it took away all the PRO icons next to the menus items, but the watermark stayed on the PDF page(s). I have filled out and signed the Viewer SDK license and emailed it in. If I'm correct in my understanding, once you receive this, you'll email me another set of keys to use in the SetDevInfo (instead of what I received) that will remove everything (the watermark AND the PRO icons as it is now) for the Viewer. Correct?

FYI - (there were 3 emails listed... one in your documentation says sales@docu-track.com, the email I got after purchase says upgrades@docu-track.com, and the license itself says upgrades@docu-track.com - so I sent it to all 3 :D )

Thank you,

Nelson
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Thumbnail Print Button

Post by Vasyl - PDF-XChange »

Hi, Nelson.

No way for removing items from context menus. This feature will be in next version(V3).

The correct code:

Code: Select all

Call CoPDFXCview1.SetProperty("Prompts.ConfirmForDeletingPages", "false", 0)
Call CoPDFXCview1.SetProperty("Prompts.ConfirmForMovingPages", "false", 0)
The names "Commands[""Prompt""].ConfirmForDeletingPages" and "Commands[""Prompt.ConfirmForDeletingPages""]" are incorrect.
2). I put in the key and dev code I received into the SetDevInfo method and it took away all the PRO icons next to the menus items, but the watermark stayed on the PDF page(s). I have filled out and signed the Viewer SDK license and emailed it in. If I'm correct in my understanding, once you receive this, you'll email me another set of keys to use in the SetDevInfo (instead of what I received) that will remove everything (the watermark AND the PRO icons as it is now) for the Viewer. Correct?
How does this watermark look like?
If these are demo-labels located in the corners of each page (screenshot #1) - that means the following: you have written this file by our SDK but without developer's key, using SDK in trial mode. That's why these labels will not disappear from these files even if you'll enter correct developer's key-code. These labels are the part of the file content.

If you have entered correct developer's key and there are the watermarks which look like on screenshot #2 - there is a problem indeed and we'll continue our investigation.

Best
Regards.
You do not have the required permissions to view the files attached to this post.
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.
nlopes
User
Posts: 33
Joined: Tue Aug 24, 2010 3:44 am

Re: Thumbnail Print Button

Post by nlopes »

Hi Vasyl,

Thank you for the assistance on the "SetProperty" for the prompts. I was very close, but used "prompt" instead of "prompts" as that what was in your previous post. I'll use these features to disable everything for now and look forward to the next version where we can hide them too.

As for the watermarks, it seems we have a much bigger issue then. Please see my attached image of what I'm referring to. I get both watermarks. When I load/scan a PDF and am viewing it, I get the big DEMO Version watermark (as in your image #2) and when I save, I get the watermark (as in your image #1) in both corners of the saved PDF. However, interestingly, I do not get the PRO icons in the context menu anymore. I'd like to state that I downloaded the "trial" version of PDF X-Change Viewer SDK from your website for extensive testing before purchasing PDF X-Change Pro SDK Bundle. I had to download the Viewer SDK separately since the examples (like the VB6 "fulldemo" were not included with the Bundle SDK download.) I have not re-installed or re-downloaded anything from you since my purchase, so it's the trial versions that are installed on my system. According to your documentation, there is no need to re-install them as they'll always function as Demo until using the SetDevInfo method. Unfortunately, when I put this information in that I received from my email, I still have the watermarks. As I mentioned before, am I to receive a separate email from you with a different set of keys for unlocking the Viewer once I send in the signed Licensed? If not, then I really need to get this resolved. The PDFXCview.exe and PDFXCviewAx.dll are in the "C:\Program Files\Tracker Software\PDF-XChange Viewer SDK\Bin" folder by default and registered there. I've verified in my VB6 project that this is indeed the control on the my form.

Any help would be greatly appreciated!

Thank you,

Nelson
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Thumbnail Print Button

Post by Vasyl - PDF-XChange »

Hi,
...I was very close, but used "prompt" instead of "prompts" as that what was in your previous post.
Sorry, my mistake. :oops:
As for the watermarks, it seems we have a much bigger issue then. Please see my attached image of what I'm referring to. I get both watermarks. When I load/scan a PDF and am viewing it, I get the big DEMO Version watermark (as in your image #2) and when I save, I get the watermark (as in your image #1) in both corners of the saved PDF. However, interestingly, I do not get the PRO icons in the context menu anymore. I'd like to state that I downloaded the "trial" version of PDF X-Change Viewer SDK from your website for extensive testing before purchasing PDF X-Change Pro SDK Bundle. I had to download the Viewer SDK separately since the examples (like the VB6 "fulldemo" were not included with the Bundle SDK download.) I have not re-installed or re-downloaded anything from you since my purchase, so it's the trial versions that are installed on my system. According to your documentation, there is no need to re-install them as they'll always function as Demo until using the SetDevInfo method. Unfortunately, when I put this information in that I received from my email, I still have the watermarks. As I mentioned before, am I to receive a separate email from you with a different set of keys for unlocking the Viewer once I send in the signed Licensed? If not, then I really need to get this resolved. The PDFXCview.exe and PDFXCviewAx.dll are in the "C:\Program Files\Tracker Software\PDF-XChange Viewer SDK\Bin" folder by default and registered there. I've verified in my VB6 project that this is indeed the control on the my form.
Strange issue... Possible two reasons of this:
1. You have an invalid key-code.
2. You have some mistake in code which sets this key-code. It should be in VB6:

Code: Select all

Call CoPDFXCview1.SetDevInfo("PVA20-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "ForMe")
In both cases please send us by email the simple VB6-example code with your dev-key-code for reproducing, to support@pdf-xchange.com.
Do not send it to this forum because it will contain your private dev-key-code.

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.
nlopes
User
Posts: 33
Joined: Tue Aug 24, 2010 3:44 am

Re: Thumbnail Print Button

Post by nlopes »

I did not receive a keycode that starts with PVA20-.... I got 2 codes in the email, a serial number and a devcode. I tried using those in the SetDevInfo where the first parameter was the serial number and second was the devcode. I just tried changing the second parameter to "ForDeveloper" and it still had watermarks. I then put the devcode provided as the first parameter and "ForDeveloper" as s the second, again, watermarks!

Both my serial and devcode start with different 5 characters and neither is PVA20. Again, am I supposed to receive that in a different email once you receive my signed license form for the viewer?

I'll try to get a little demo ready and send it to your support email.

Thank you,

Nelson
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Thumbnail Print Button

Post by Stefan - PDF-XChange »

Hello Nelson,

I have already sent you an e-mail with the correct license agreement.
Once we receive this one signed we will provide you the PVA20- code.

Sorry for the delay but the file you sent us was not the correct one.

Best,
Stefan
nlopes
User
Posts: 33
Joined: Tue Aug 24, 2010 3:44 am

Re: Thumbnail Print Button

Post by nlopes »

Vasyl,

1). I'm trying to disable a confirm save prompt that is coming up with the Viewer and I can't seem to get this one. I've tried the following:

Call CoPDFXCview1.setProperty("Prompts.ConfirmCloseAllDocuments", 0)
Call CoPDFXCview1.setProperty("Prompts.ConfirmSaveDocuments", 0)
Call CoPDFXCview1.setProperty("Prompts.ConfirmSaveDocument", 0)
Call CoPDFXCview1.setProperty("Prompts.ConfirmSave", 0)

None of them were successful (the last 3 are invalid as I was trying to guess). Do you have one for this please? Here's what I'm doing.... I open a PDF file in the viewer, let's call it "temp.pdf" (that was scanned in by the user). I allow the user to move the pages around (via thumbnails) as well as delete pages, etc... When they hit save, I save the document with a new name, let's say "final.pdf". Then I close all documents in the viewer to exit. At that point, I get a confirmation dialog from the viewer asking me if I was to save the "temp.pdf" changes. I never save it with that filename (as I saved it with a different filename and my application will delete temp copy when they exit). So, I was just wondering if there was a way to bypass the confirm save on closing? Or am I force to save the file with the same filename I opened it as?

2). I have successfully disabled many of the items in the thumbnails right-click context menu, including the Print button. But there is also a small X to close the thumbnail pane. Anyway to disable this? I want the thumbnails to always be visible in this instance. If not, I'll need to implement a show/hide thumbnail pane button in case they close it. Currently I show it initially with

Call CoPDFXCview1.DoVerb("", "ExecuteCommand", 32912, vDataOut)

Is there a better way to show it and/or have it shown permanently?

3). I call the command CoPDFXCview1.SaveDocument 0, DestPathname to save my file. However, if the path does not exist, it does not automatically get created and I get an error that the path doesn't exist. I looked at the other optional parameers of SaveMode and Flags, but did not see this as an option. Is it possible? If not, will it be in the next version?

Thank you,

Nelson
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Thumbnail Print Button

Post by Vasyl - PDF-XChange »

Hi, Nelson.
1). I'm trying to disable a confirm save prompt that is coming up with the Viewer and I can't seem to get this one. I've tried the following:

Call CoPDFXCview1.setProperty("Prompts.ConfirmCloseAllDocuments", 0)
Call CoPDFXCview1.setProperty("Prompts.ConfirmSaveDocuments", 0)
Call CoPDFXCview1.setProperty("Prompts.ConfirmSaveDocument", 0)
Call CoPDFXCview1.setProperty("Prompts.ConfirmSave", 0)

None of them were successful (the last 3 are invalid as I was trying to guess). Do you have one for this please? Here's what I'm doing.... I open a PDF file in the viewer, let's call it "temp.pdf" (that was scanned in by the user). I allow the user to move the pages around (via thumbnails) as well as delete pages, etc... When they hit save, I save the document with a new name, let's say "final.pdf". Then I close all documents in the viewer to exit. At that point, I get a confirmation dialog from the viewer asking me if I was to save the "temp.pdf" changes. I never save it with that filename (as I saved it with a different filename and my application will delete temp copy when they exit). So, I was just wondering if there was a way to bypass the confirm save on closing? Or am I force to save the file with the same filename I opened it as?
You may intercept two events Prompts.ConfirmDocumentSave and Prompts.ConfirmDocumentIncSave, see [Preferences/Named Items/Objects/Prompts].
2). I have successfully disabled many of the items in the thumbnails right-click context menu, including the Print button. But there is also a small X to close the thumbnail pane. Anyway to disable this? I want the thumbnails to always be visible in this instance. If not, I'll need to implement a show/hide thumbnail pane button in case they close it. Currently I show it initially with
Call CoPDFXCview1.DoVerb("", "ExecuteCommand", 32912, vDataOut)
Is there a better way to show it and/or have it shown permanently?
To hide/show thumbnails pane call (see [Preferences/Named Items/Objects/Documents/<Item>/View]):
Call CoPDFXCview1.SetDocumentProperty(docId, "View.Panes["Thumbnails"].Visible", "false|true", 0)
And you cannot disable the small close button in current implementation.
3). I call the command CoPDFXCview1.SaveDocument 0, DestPathname to save my file. However, if the path does not exist, it does not automatically get created and I get an error that the path doesn't exist. I looked at the other optional parameers of SaveMode and Flags, but did not see this as an option. Is it possible? If not, will it be in the next version?
...However, if the path does not exist, it does not automatically get created and I get an error that the path doesn't exist....
Very strange: the nature of CoPDFXCview1.SaveDocument is - it should create destination file by specified full file name if it has all permissions for this purpose.
Please check it again and if problem still send us the simple example for reproducing. Sure, for example, if you specified destination file name with invalid(nonexistent) drive letter then our control will generate the save-error message.
In any case you may use the special flag PXCVA_NoUI in the Flags argument to skip all error/confirm-messages.

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.