目前,jspdf方法仅显示内容和图像,但如何包含单选按钮图标.
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#cmd').click(function () {
doc.fromHTML($('#content').html(), 15, 15, {
'width': 170,
'elementHandlers': specialElementHandlers
});
doc.save('sample-file.pdf');
});Run Code Online (Sandbox Code Playgroud)
<div id="content">
<input type="radio">CT Scan
</div>
<div id="editor"></div>
<button id="cmd">generate PDF</button>Run Code Online (Sandbox Code Playgroud)
我想在pdf中包含收音机和复选框图标.
我正在尝试使用 Spring Security 来连接 LDAP,但它总是显示错误的凭据问题。
我想我的代码可能有问题:
@Configuration\n@EnableWebSecurity\n@EnableGlobalMethodSecurity(prePostEnabled = true)\npublic class SecurityConfig extends WebSecurityConfigurerAdapter {\n @Override\n public void configure(WebSecurity web) throws Exception {\n web.debug(true);\n }\n @Autowired\n public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\n\n auth.ldapAuthentication().userDnPatterns("sAMAccountName={0},OU=SupportUsers,OU=Users,OU=company,DC=ad,DC=company,DC=com,DC=pl")\n .contextSource(contextSource()).passwordCompare().passwordAttribute("userPassword");\n }\n protected void configure(HttpSecurity http) throws Exception {\n http\n .authorizeRequests()\n .anyRequest().fullyAuthenticated()\n .and()\n .formLogin();\n http.csrf().disable(); //Vaadin already have built in csrf\n }\n @Bean\n public LdapContextSource contextSource () {\n LdapContextSource contextSource= new LdapContextSource();\n contextSource.setUrl("ldap://192.168.2.2:389");\n contextSource.setBase("dc=ad,dc=company,dc=com,dc=pl");\n contextSource.setUserDn("CN=lister,OU=SupportUsers,OU=Users,OU=company,DC=ad,DC=company,DC=com,DC=pl");\n contextSource.setPassword("examplePassword");\n contextSource.setAnonymousReadOnly(false);\n contextSource.setPooled(true);\n contextSource.afterPropertiesSet();\n return contextSource;\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n我在代码中找不到错误,也许我做错了事情。这是我的 pom.xml:
\n\n …我正在尝试在vaadin应用程序中实现spring security,但是我有一个问题,在登录到页面后,它显示了一个错误:
{"status":403,"error":"Forbidden","message":"无法验证提供的CSRF令牌,因为找不到您的会话.","path":"/"}
我尝试了很多东西,但没有一个工作,这是我的标准安全配置类:
//SecurityConfig.java
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("user")
.password("password")
.roles("USER");
}
}
Run Code Online (Sandbox Code Playgroud)
控制器类:
//HomeController.java
@RestController
public class HomeController {
@GetMapping("/")
public String index() {
return "Welcome to the home page!";
}
@GetMapping("/error")
public String error(){
return "Error!";
}
Run Code Online (Sandbox Code Playgroud)
}
和Vaadin UI类
//VaadinUI.java
@SpringUI
public class VaadinUI extends UI {
VerticalLayout layout = new VerticalLayout();
com.vaadin.ui.Label label = new com.vaadin.ui.Label("Witaj");
@Autowired
public VaadinUI() {}
@Override …Run Code Online (Sandbox Code Playgroud)