Well the title pretty much explains the problem.
I have a InDesign document containing buttons.
One of the buttons should go back to the page the user comes from (previous page).
So I want to create a var containing the value of the pagenumber on the button on the previous page like this:
var prevPage = this.pageNum;
Then on the button that should get the user back to where he came from add this:
this.pageNum = prevPage;
This works if I do this after the PDF is created. But since this is a time consuming hassle to do every time the client makes corrections I would like to do it in InDesign.
I know I can add an action to the button containing a menu-action "go to previous page". This literally goes through the Acrobat menu and takes you to the previous page.
The problem is that the Acrobat app doesn't have that menu. So the action can't find the menu items and won't work.
I would like to add a script to the button... but seriously wondering if this is possible. I couldn't even find a plugin that does this.
Hope the stack-brothers have a solution.
Use the script below for the button action. It to the previous view on the view stack, which is equivalent to clicking the Previous View button on the Acrobat toolbar.
app.goBack();
Related
I have a setup where I display a list of buttons and clicking on the buttons triggers a function that contacts a firebase database and gets the contents of a 'slide' that is to be shown to the user. The function then clears the content of the page and then creates elements from the data acquired from the database.
Now obviously, when I press back browser button once I've replaced the content, it won't take me back to the previous content. But I believe that my user's experience will be much better if it actually took them back to the list of buttons. I have two faint ideas on how to go about solving this problem but I'm lacking in specific details of how I can go about it.
Possible Solution 1:
Some way to dynamically create a new page using javascript and then serve it to the user.
Possible Solution 2:
Some way to simulate that the page has changed location. Maybe using anchoring links.
Let me know if you have any other solutions in mind or if you know how I should go about implementing these. Your help will be much appreciated. :D
Current working code to go back one page:
onclick="location.href=document.referrer; return false;
This code allows me to go back by one page only. Are there any code snippets that would allow to go back multiple pages similar to a browser's back button?
I understand there is a go() method to use with window.history.go(-i) but that doesn't solve the need. I am hoping to show a list of pages visited for a user to click on the desired page. This is similar functionality to a browser's back button.
In essence, trying to go back sequentially instead of jumping back x number of pages.
Thanks in advance for all of your inputs.
So I have 3 forms all on one page, and I have buttons on all those forms to go show or hide previous/next forms. However the back button just takes you to the previous page entirely. Is there a way to have the back button to check if there is a previously completed form and go to that form?
Sorry for the open ended question but I'm at a loss.
Using a database to save your previous walk, will be better trying to,manipulate hiding button using styles and JavaScript will get you in cache mess someday ,,
Please paste your code here for we can see wat u have done,,
Is there a way in Adobe Acrobat to detect if a user is on the last page? What I would like to do is set some document javascript to trigger once they are on the last page. I know how to setup the document javascript in Acrobat, just haven't found any way to detect what page its on. Ideally it would be nice to be able to get the current page and page count and compare, but even if there is a current page variable, I could just hard code the last page. My fallback will be to add a button or checkbox on the last page, but would like to avoid that. Any help would be appreciated. Thanks.
Pages have actions just like fields do, so in your case, you could use the last page's Open event to trigger your Javascript.
To set a page action, open the "Page Thumbnails" navigation pane on the left, right click the page, then add an action as you would to a field. Alternatively, a page action can be set via Javascript. In your case this would look something like this.setPageAction(this.numPages-1, "Open", action);
Hello I have asked this question before but perhaps it wasn't clear or was deemed irrelevant but I need to figure out how to make a button OnClick create a button on another XML layout.
I am very new to java and coding in general and have looked for the past few days but can not find any information on how I would go about this.
The closest I could get was another users question on stackoverflow where the method of keeping the button I want to create invisible and having it switch visibility OnClick of original button, but this isn't feasible.
While this method would work for the single button I need to click to generate the other button, the place it would generate it will also generate a different variety of buttons from other sources. The only way this seems possible is to have the dozens of invisible buttons from each source already stored there and that doesn't seem like the most logical way to approach it code wise.
I would greatly appreciate any help in this area, I'm not expecting anyone to show me how it's done or write me sample code if you could simply nudge me in the direction of an online guide,tutorial or information source I'd be very grateful,
Thanks for your patience.
Creating Button programmatically and adding to the LinearLayout.
//First get the reference of LinearLayout where you need to add the buttons.
LinearLayout ll=(LinearLayout)findViewbyId(R.id.llayout);
// Layout Param
LayoutParams param = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
/* This line of code to add the button in layout (implement your own logic i.e how many time you need to add the button and at which condition you need to add).*/
Button button = new Button(Context);
button.setText("dynamic button 1");
ll.addView(button,param);
Hope this achieve your goal.