Page 1 of 1

ExtractPages

Posted: Tue Mar 26, 2013 4:45 pm
by jeffp
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);

Re: ExtractPages

Posted: Tue Mar 26, 2013 7:15 pm
by Nico - Tracker Supp
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,

Re: ExtractPages

Posted: Tue Mar 26, 2013 7:48 pm
by jeffp
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.

Re: ExtractPages

Posted: Wed Mar 27, 2013 12:33 am
by Nico - Tracker Supp
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,