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

Create a "insert file" button

New Here ,
May 18, 2016 May 18, 2016

Hey All,

I'm chasing the java-script  to create a button that will insert a PDF (like a Map) into the existing form as a new page ??

Using Adobe Acrobat Pro XI

Thanks

TOPICS
Acrobat SDK and JavaScript , Windows
343
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
LEGEND ,
May 18, 2016 May 18, 2016

If this needs to work with Reader, you can insert a page by spawning a template (template.spawn method) that includes a button that's used to display the contents of a page that you can import from an existing PDF (field.buttonImportIcon method). If it just needs to work with Acrobat, you can simply use the doc.insertPages JavaScript method.

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
LEGEND ,
May 18, 2016 May 18, 2016

Also, the Reader approach using a template can only work with Reader 11 and DC, not earlier versions.

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 ,
May 18, 2016 May 18, 2016

Thanks George

Ok that sound simple enough, but i'm amateur when it comes to Java-script so where would i find an example of this ?? i've searched high and low... maybe i'm looking in the right direction ??

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
LEGEND ,
May 18, 2016 May 18, 2016
LATEST

Here's a link to a barebones demo of the method that will work with Reader: http://acroscript.net/pdf/demos/addTemplateDemo1.pdf

It includes a hidden template page with the imaginative name of "t1". When you click the button on the first page, it will generate a new page by spawning the hidden template and send you to that page. When you click the "Load Page" button, it will prompt you to select a PDF, and then a page from the PDF, to use for the icon of the large button above it. This should get you started with your attempt to replicate this type of thing. Post again if you have any questions.

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