I am using ASPNETZERO's Angular 4 + .Net Core.
I have a grid that displays a list of the user's submitted forms and a column with a button to print the form.
Here's my print function; I'm passing the url for the ConvertUrl() method in the input:
print(item: FormSummaryDto) {
this.beginTask();
let formUrl = AppConsts.appBaseUrl + '/#/app/main/form/' + item.formType.toLowerCase() + '/' + item.id + '/print';
let input = new ExportFormInput({ formId: item.id, formUrl: formUrl, includeAttachments: true });
this.service.exportFormToPdf(input)
.finally(() => { this.endTask(); })
.subscribe((result) => {
if (result == null || result.fileName === '') {
return;
}
this._fileDownloadService.downloadTempFile(result);
}, error => console.log('downloadFile', 'Could not download file.'));
}
Everything is working fine with the process of converting and downloading the file, however, when I do the convert (below) the url redirects to the login page because of authentication and it's that page being converted.
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl(url);
doc.Save(file);
doc.Close();
I don't know how to use SelectPdf's authentication options with ASPNETZERO and am hoping that someone knows of a way that I can pass the current session/credentials or how to use one of SelectPdf's authentication options so it converts the passed url.
Thank!
Wg