Inserting pages from another document in a script
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software
-
- User
- Posts: 132
- Joined: Wed Mar 09, 2016 12:47 am
Inserting pages from another document in a script
I'm trying to add a page from another document (which has form fields) in the current document using the Acrobat API method 'insertPages' and this works well.
The problem occurs when I repeat this script more than once. The method has no provision to rename fields when inserting a page, so I end up with duplicate field names.
Is there any programmatic way to do this without producing duplicate field names?
P.S. I can't afford Tracker's SDK
The problem occurs when I repeat this script more than once. The method has no provision to rename fields when inserting a page, so I end up with duplicate field names.
Is there any programmatic way to do this without producing duplicate field names?
P.S. I can't afford Tracker's SDK
- TrackerSupp-Daniel
- Site Admin
- Posts: 4256
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Inserting pages from another document in a script
i do know that using the insert pages function from the toolbars does this automatically, though i cant seem to call the exact function in a button myself. You could try looking into that method of doing so, but i would suggest just simply using the toolbar function as it already exists to serve that purpose.
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
- TrackerSupp-Daniel
- Site Admin
- Posts: 4256
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Inserting pages from another document in a script
I forgot to note, you do need to select the dropdown option, Copy with Rename for this method to work
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
- User
- Posts: 132
- Joined: Wed Mar 09, 2016 12:47 am
Re: Inserting pages from another document in a script
I'm familiar with the toolbar approach, but this needs to be done programmatically.TrackerSupp-Daniel wrote:i do know that using the insert pages function from the toolbars does this automatically, though i cant seem to call the exact function in a button myself. You could try looking into that method of doing so, but i would suggest just simply using the toolbar function as it already exists to serve that purpose.
Is there any programmatic way to do this without producing duplicate field names?
- Tracker Supp-Stefan
- Site Admin
- Posts: 14208
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Inserting pages from another document in a script
Hello Claude Vidal,
Looking at the JS method - there's no provision to provide parameters for what to happen with e.g. form fields.
So I do not believe this can be controlled via that particular command directly.
What you will need to do is e.g. read the file from which you will import pages (this will require you to open it), grab all field names, check for duplicates, and if nay exist - change the field names in the source file before merging it's pages in the target.
Regards,
Stefan
Looking at the JS method - there's no provision to provide parameters for what to happen with e.g. form fields.
So I do not believe this can be controlled via that particular command directly.
What you will need to do is e.g. read the file from which you will import pages (this will require you to open it), grab all field names, check for duplicates, and if nay exist - change the field names in the source file before merging it's pages in the target.
Regards,
Stefan
-
- User
- Posts: 132
- Joined: Wed Mar 09, 2016 12:47 am
Re: Inserting pages from another document in a script
That was my finding as well. Thanks.Tracker Supp-Stefan wrote:Hello Claude Vidal,
Looking at the JS method - there's no provision to provide parameters for what to happen with e.g. form fields.
So I do not believe this can be controlled via that particular command directly.
What you will need to do is e.g. read the file from which you will import pages (this will require you to open it), grab all field names, check for duplicates, and if nay exist - change the field names in the source file before merging it's pages in the target.
Regards,
Stefan
- TrackerSupp-Daniel
- Site Admin
- Posts: 4256
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Inserting pages from another document in a script

Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Support Technician
Tracker Software Products (Canada) LTD
Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623