Login | |
The LoginOptions type exposes the following members.
| Name | Description | |
|---|---|---|
| LoginOptions |
| Name | Description | |
|---|---|---|
| DelayAfter | Gets or sets the delay, in seconds, inserted after the login form is submitted, allowing the protected page to load. Defaults to 20. | |
| DelayBefore | Gets or sets the delay, in seconds, inserted before the login form is submitted. Defaults to 20. | |
| LoginPage | Gets or sets the URL of the login page the converter opens to perform the login. | |
| Password | Gets or sets the password typed into the password field during login. | |
| PasswordFieldSelector | Gets or sets the CSS selector that identifies the password input field on the login page. | |
| SubmitButtonSelector | Gets or sets the CSS selector that identifies the submit button on the login page. | |
| Username | Gets or sets the user name typed into the user name field during login. | |
| UsernameFieldSelector | Gets or sets the CSS selector that identifies the user name input field on the login page. |
HtmlToPdf converter = new HtmlToPdf(); converter.Options.LoginOptions.LoginPage = "https://example.com/login"; converter.Options.LoginOptions.UsernameFieldSelector = "#user"; converter.Options.LoginOptions.PasswordFieldSelector = "#pass"; converter.Options.LoginOptions.SubmitButtonSelector = "#submit"; converter.Options.LoginOptions.Username = "user"; converter.Options.LoginOptions.Password = "secret"; PdfDocument doc = converter.ConvertUrl("https://example.com/dashboard"); doc.Save("out.pdf"); doc.Close();