Question: i'm using the AxAcroPDFLib.AxAcroPDF Tool from the toolbox and am having it a specific PDF when i click a button. I have a separate button (button2) and Textbox which i want to use to automatically move the PDF page to the page number entered into the TextBox when button2 is pressed.

The following code isn't working and i'm not sure what code to use to get it to work (and no i cannot just use the tools inside the PDF reader to do this as i need all the controls on monitor 1 and the PDF is displayed on Montior 2, i've sorted this part):

KEY: dsm = form2 | pdfview = the PDF reader inside form2

```
dsm.pdfview.setCurrentPage(TextBox1.Text);

```

This isn't working. i've also tried:

```
dsm.pdfview.setCurrentPage = TextBox1.Text;

```

Also not working. Any help would be great! Thanks.

Answer: 
The question was specifically for Spring boot. I am using the following approach which works well, please suggest if there is a way not to use new and use Spring for configuring it.

```
 import java.util.ArrayList;
 import java.util.List;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
 import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
 import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
 import com.mongodb.Mongo;
 import com.mongodb.MongoClient;
 import com.mongodb.MongoClientOptions;
 import com.mongodb.MongoCredential;
 import com.mongodb.ServerAddress;

 @Configuration
 @EnableMongoRepositories("com.myapp.repository")
 public class SpringMongoConfig extends AbstractMongoConfiguration {

@Value("${myapp.mongodb.host}")
private String host;

@Value("${myapp.mongodb.port}")
private int port;

@Value("${myapp.mongodb.database}")
private String mongoDB;

@Value("${myapp.mongodb.userName}")
private String userName;

@Value("${myapp.mongodb.password}")
private String password;

@Value("${myapp.mongodb.socketTimeoutMS}")
private int socketTimeout;

@Value("${myapp.mongodb.connectionTimeoutMS}")
private int connectionTimeout;

@Override
public MongoMappingContext mongoMappingContext() throws ClassNotFoundException {
return super.mongoMappingContext();
}

@Override
@Bean
public Mongo mongo() throws Exception {

List<ServerAddress> servers = new ArrayList<ServerAddress>();
servers.add(new ServerAddress(host, port));

List<MongoCredential> creds = new ArrayList<MongoCredential>();
creds.add(MongoCredential.createCredential(userName, mongoDB, password.toCharArray()));

MongoClientOptions builder = MongoClientOptions.builder().socketTimeout(socketTimeout).connectTimeout(connectionTimeout).build();

return new MongoClient(servers, creds, builder);
}

@Override
protected String getDatabaseName() {
return mongoDB;
}
}

```
I found the following document with a possible solution.

<https://www.programmersought.com/article/1927319190/>

It mentions the following:

```
spring.data.mongodb.address=172.16.250.234:27017,172.16.250.239:27017,172.16.250.240:27017
spring.data.mongodb.replica-set=rs0
spring.data.mongodb.database=test
spring.data.mongodb.username=admin
spring.data.mongodb.password=admin

# Configure spring.data.mongodbDB Pool
spring.data.mongodb.min-connections-per-host=10
spring.data.mongodb.max-connections-per-host=100
spring.data.mongodb.threads-allowed-to-block-for-connection-multiplier=5
spring.data.mongodb.server-selection-timeout=30000
spring.data.mongodb.max-wait-time=120000
spring.data.mongodb.max-connection-idel-time=0
spring.data.mongodb.max-connection-life-time=0
spring.data.mongodb.connect-timeout=10000
spring.data.mongodb.socket-timeout=0
spring.data.mongodb.socket-keep-alive=false
spring.data.mongodb.ssl-enabled=false
spring.data.mongodb.ssl-invalid-host-name-allowed=false
spring.data.mongodb.always-use-m-beans=false
spring.data.mongodb.heartbeat-socket-timeout=20000
spring.data.mongodb.heartbeat-connect-timeout=20000
spring.data.mongodb.min-heartbeat-frequency=500
spring.data.mongodb.heartbeat-frequency=10000
spring.data.mongodb.local-threshold=15
spring.data.mongodb.authentication-database=auth_dev

```

I'm trying to test this now to make sure it is working, but it at least seems plausible.