1

I'me using Selectpdf to generate and save PDF files by HTML page. I'm also using bootsrap in my page. I'm loading via https, and I want load locally.

I have this:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

I want this:

<link  rel="stylesheet" media="all" href="lib/bootstrap-5.1.3-dist/css/bootstrap.min.css" crossorigin="anonymous"/>
<script src="lib/bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>

But when I try load locally, files are not load.

Someone can help me?

  • If you're trying to do same origin requests, don't add `crossorigin` attribute – Pablo Recalde Apr 12 '22 at 13:31
  • Anyway this is super trivial, just go to your network tab in the dev tools, look at the url it's trying to load and the response your browser is getting. If you can't directly open the js file with that route, neither does your page. So A) the url is wrong, b) your http server is not serving that. In aspnetcore, [statics...](https://learn.microsoft.com/en-us/dotnet/architecture/porting-existing-aspnet-apps/serving-static-files) – Pablo Recalde Apr 12 '22 at 13:33
  • @PabloRecalde my HTML page is perfect, everything is loaded. But when I'm using SelectPdf (export HTML page to PDF) these files are not laoded. My problem is with SelectPdf. – Marcelo Antunes Fernandes Apr 12 '22 at 13:42

0 Answers0