ExtractPages

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

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

Post Reply
jeffp
User
Posts: 861
Joined: Wed Sep 30, 2009 6:53 pm

ExtractPages

Post by jeffp » Tue Mar 26, 2013 4:45 pm

I want to be able to extract PDF pages to file WITHOUT the Viewer adding the newly created file to a new Tab in the editor.

The code below does this sometimes, but sometimes, a new Tab will appear in the editor. The new Tab seems to appear only after I've done a similar extract from your UI by right-clicking some pages and selected "Extract Pages".

I can write some code to immediately close the new document tab once created, but I want to figure out why sometimes a tab is create and sometimes not.

Seems like there is a missing property in the SDK that would control whether a new document is created or not, which would correspond to the "Save Extracted Pages to New File" item in your Extract Pages dialog.

Code: Select all

    FControl.SetProperty('Operations.ExtractPages.RangeType', 'Exact', 0);
    FControl.SetProperty('Operations.ExtractPages.RangeText', APages, 0);
    FControl.SetProperty('Operations.ExtractPages.DeleteAfterExtract', 0, 0);
    FControl.SetProperty('Operations.ExtractPages.ExtractToFiles', 1, 0);
    FControl.SetProperty('Operations.ExtractPages.ToOneFile', 1, 0);
    FControl.SetProperty('Operations.ExtractPages.DestFolder', ADir, 0);
    FControl.SetProperty('Operations.ExtractPages.DestFileName', AName, 0);
    FControl.DoDocumentVerb(ADocID, '', 'ExtractPages', vIn, vOut, PXCVA_NoUI);

Nico - Tracker Supp
User
Posts: 220
Joined: Fri May 18, 2012 8:41 pm

Re: ExtractPages

Post by Nico - Tracker Supp » Tue Mar 26, 2013 7:15 pm

Hi jeffp,

Thank you for your post.
The code you posted seems right, I cannot account for the full-qualified directory and names or user permissions.
Please send us a small and simple project what we can test and run.
Thanks.

Sincerely,

jeffp
User
Posts: 861
Joined: Wed Sep 30, 2009 6:53 pm

Re: ExtractPages

Post by jeffp » Tue Mar 26, 2013 7:48 pm

Here's how you can recreate it.

1. Open a multi-page PDF document in the Viewer.

2. Run my code and a new document will be saved to file (no new tab created)

3. Now, in the editor, select a few pages and right-click and choose Extract Pages which brings up your Extract Pages dialog.

4. In this dialog, choose the "Save Extracted Pages to New File" option and proceed to save these pages to file (a new Tab will appear also)

5. No rerun my code and this time a document will be saved to file AND a new document tab will appear in the Viewer.

Nico - Tracker Supp
User
Posts: 220
Joined: Fri May 18, 2012 8:41 pm

Re: ExtractPages

Post by Nico - Tracker Supp » Wed Mar 27, 2013 12:33 am

Hi jeffp,

Thank you for your post.
I manage to reproduce the defect and will be fixed for next version of the SDK.
As a workaround, set the property "Operations.ExtractPages.SaveAfterExtract" to zero (false) before calling DoDocumentVerb.
Thanks.

Sincerely,

Post Reply