InsertPages operation

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

anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

InsertPages operation

Post by anovy »

Hi, I found that
DoVerb("Documents[#id]","InsertPages",NULL,NULL,PXCVA_NoUI);
returns always S_OK, even if the source file (set via "Operations.InsertPages.File") is invalid or does not exists.
Could you please check this?
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: InsertPages operation

Post by Corwin - Tracker Sup »

Hi anovy,

This problem will be fixed in next build. Thanks for info.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: InsertPages operation

Post by anovy »

For your information more my findings:
- If the source (inserted) file has not 'page extract permission', then InsertPages also incorrectly returns S_OK (although correctly no page is inserted).
- If the target document has not 'change permission', then InsertPages returns correct value (corresponding error string "No permission for current action").
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: InsertPages operation

Post by anovy »

And one more question:
What permisson must have the source PDF file for InsertPages? I thought that this must be 'page extraction', but now I see that probably 'content copying'?
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: InsertPages operation

Post by John - Tracker Supp »

On checking - there is a bug here - you should only require allow 'Document Assembly' to insert pages but currently we require full editing, we will correct this in build 53 (too late for 52 I am afraid).

Though note to delete pages - full editing rights are always required.
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
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: InsertPages operation

Post by anovy »

Thanks, but I asked for the permissons of the source file. So what permissions must have the source PDF file from which the pages are taken.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: InsertPages operation

Post by Vasyl - PDF-XChange »

Hi anovy.
What permission must have the source PDF file for InsertPages? I thought that this must be 'page extraction', but now I see that probably 'content copying'?
You are right and you may check it by:

Code: Select all

DoDocumentVerb(srcDocID, NULL, "IsOperationGranted", dataIn(2,5), dataOut, 0);
canExtractPages = (dataOut != 0);
Also you may check destination PDF for pages inserting by:

Code: Select all

DoDocumentVerb(srcDocID, NULL, "IsOperationGranted", dataIn(2,16), dataOut, 0);
canInsertPages = (dataOut != 0);
Sorry, but the "IsOperationGranted" operation is still undocumented in the latest release - see the updated help file in the attachment, [Reference/NamedItems/Documents/Item/Menthods/IsOperationGranted] section.

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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: InsertPages operation

Post by anovy »

Thanks Vasyl, but the source file is not opened in viewer, so this check (via docid) is not useful.
However it will be enough for me if the InsertPages operation will return a correct handle with corresponding error string from GetTextFromResult.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: InsertPages operation

Post by anovy »

One more question:
dataIn(2,5),
It is VARIANT with SAFEARRAY?
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: InsertPages operation

Post by Vasyl - PDF-XChange »

Yes. You may use our IPDFXCargs interface to read/write the SAFEARRAY structure.
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.