Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

Invalid arguments on Doc.insertPages - Acrobat SDK

New Here ,
Jun 15, 2023 Jun 15, 2023

I'm trying to insert a page into an attachment of a PDF. I have a main pdf file called "Ctrl.pdf" that has several attachments. Inside a Trusted Function called via button in "Ctrl.pdf" I get the Doc of the attachment:

 

att = this.openDataObject("myAttachment.pdf");

 

 
Then I try to insert a page to that attachment:

 

att.insertPages ({
    nPage: 0,
    cPath: "/c/new-pages.pdf",
    nStart: 0
});

 

 
But get the following error: 
InvalidArgsError: Invalid arguments.
Doc.insertPages
I dont see how the arguments are wrong, I'm sure the location is correct, also tryed with relative path but nothing changed.
TOPICS
How to
630
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2023 Jun 15, 2023

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

 

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post if it helps you get responses.

 

<moved from using the community>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2023 Jun 15, 2023

Try this :

Put the file in a folder of the C drive

E.g. /C/temp/...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 16, 2023 Jun 16, 2023

I thought that might be the case, too, but it doesn't seem to be. It seems some types of editing of the attached document are allowed, and others are not... It's very odd. It might have to do with the fact that it is opened as a hidden document, instead of being displayed on the screen. For example, I was able to modify the file's metadata using a similar code, but not the pages in it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 23, 2023 Jun 23, 2023
LATEST

Thamks for the reply, but it doesn't seem to be the problem, previously the file was in a subfolder and the error was the same.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines