why bootstrapcss not apply of coverTemplate?



  • why bootstrapcss not apply of coverTemplate?

    .net core

    var pdf = await JsReportMVCService.RenderAsync(new RenderRequest
                   {
                         Template = new Template()
                        {
                              Content = result,
                              Engine = Engine.Handlebars,
                              Recipe = Recipe.ChromePdf,
                              PdfOperations = new List<PdfOperation>()
                             {
                                new PdfOperation()
                               {
                                   Template = new Template
                                  {  
                                      Engine = Engine.Handlebars,
                                      Recipe = Recipe.ChromePdf,
                                      Content = cover,
                                  },
                                 Type = PdfOperationType.Prepend
                             }
                          }
              },
    

    There is a bootstrap link in the content

     <head>
         <link href="/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
     </head>
    

    Bootstrap is applied to pages included in the content, but templates applied with Type = PdfOperationType.Prepend are not applied.



  • I don't see a reason why it should work in the main while shouldn't in the pdf utils operation.

    Are you sure this properly resolves /lib/bootstrap/dist/css/bootstrap.css ? The same is in both result and cover when you inspect it?

    Are use sure the bootstrap isn't applied? The bootstrap has different styles for printing and normal browser display. jsreport by default uses media print, so the pdf output may look differently than in the browser.
    You can use Template.Chrome.MediaType prop for setting the screen media that browsers use for display.
    https://github.com/jsreport/jsreport-dotnet-types/blob/master/jsreport.Types/Request/Chrome.cs#L29


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.