Button does not work

New Here ,
Sep 11, 2018

Copy link to clipboard

Copied

Hello All,

I'm trying to make a new 3D PDF template for Inventor with use of the autodesk samples.

Dropbox - Sample Assembly Template.pdf

The buttons I want to reproduce are, front view, back view, top view etc.

The code used is very simple:

this.akBom.setCameraToCannedView(this, "FRONT");

However, when I copy the existing button to a new form or reproduce it with the same settings and this JavaScript code it does not work.

Do you have an idea what I'm missing or need to do to get this to work?

Kind regards,

Peter

Adobe Community Professional
Correct answer by Joel_Geraci | Adobe Community Professional

The buttons call a functions that reside in a document level script. The buttons won't work when you just copy them into another document, you also need to copy the document level script.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

151

Likes

Translate

Translate

Report

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

Button does not work

New Here ,
Sep 11, 2018

Copy link to clipboard

Copied

Hello All,

I'm trying to make a new 3D PDF template for Inventor with use of the autodesk samples.

Dropbox - Sample Assembly Template.pdf

The buttons I want to reproduce are, front view, back view, top view etc.

The code used is very simple:

this.akBom.setCameraToCannedView(this, "FRONT");

However, when I copy the existing button to a new form or reproduce it with the same settings and this JavaScript code it does not work.

Do you have an idea what I'm missing or need to do to get this to work?

Kind regards,

Peter

Adobe Community Professional
Correct answer by Joel_Geraci | Adobe Community Professional

The buttons call a functions that reside in a document level script. The buttons won't work when you just copy them into another document, you also need to copy the document level script.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

152

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 11, 2018 0
Adobe Community Professional ,
Sep 11, 2018

Copy link to clipboard

Copied

Look at the Javascript console for errors.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0
New Here ,
Sep 11, 2018

Copy link to clipboard

Copied

Thanks for the fast reply.

It only gives me this error:

ReferenceError: ANARKCOREDATA is not defined

6:Document-Level:AnarkCoreScript

But this error is also given in the Autodesk sample that works (Inventor uses AnarkCore to export to 3D PDF).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0
Adobe Community Professional ,
Sep 11, 2018

Copy link to clipboard

Copied

When I try the button I get the error:

this.akBom is undefined

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0
New Here ,
Sep 11, 2018

Copy link to clipboard

Copied

This is the output when I use the template, all buttons work:

Dropbox - CEP.01276.04.02-01104.pdf

When I copy the template buttons to a new template and Generate the output, no buttons work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0
Adobe Community Professional ,
Sep 11, 2018

Copy link to clipboard

Copied

The buttons call a functions that reside in a document level script. The buttons won't work when you just copy them into another document, you also need to copy the document level script.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0
Adobe Community Professional ,
Sep 11, 2018

Copy link to clipboard

Copied

In this document the object this.akBom is defined.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0
New Here ,
Sep 11, 2018

Copy link to clipboard

Copied

Thanks Joel!

Thats what I was searching for.

I think this will be enough to get it to work.

Thanks, Bernd for your help as well!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2018 0