-2

I am using laravel-snappy to genrate a pdf of my html page but i am getting this error:

The exit status code '-1073741819' says something went wrong:


stderr: "Loading pages (1/6)


[>                                                           ] 0%

[======>                                                     ] 10%

[======>                                                     ] 11%

Warning: Failed to load http://127.0.0.1:8000/css/app.css (ignore)

 ◀
Warning: Failed to load http://127.0.0.1:8000/fullcalendar/packages/core/main.css (ignore)


Warning: Failed to load http://127.0.0.1:8000/fullcalendar/packages/daygrid/main.css (ignore)


Warning: Failed to load http://127.0.0.1:8000/fullcalendar/packages/core/main.js (ignore)


Warning: Failed to load http://127.0.0.1:8000/fullcalendar/packages/interaction/main.js (ignore)


Warning: Failed to load http://127.0.0.1:8000/fullcalendar/packages/daygrid/main.js (ignore)


Warning: Failed to load http://127.0.0.1:8000/fullcalendar/packages/timegrid/main.js (ignore)


Error: Failed to load http://127.0.0.1:8000/js/jQuery.min.js, with network status code 99 and http status code 0 - Unknown error


"


stdout: ""


command: C:\xampp\htdocs\EDO_Roster\vendor\wemersonjanuario\wkhtmltopdf-windows\bin\wkhtmltopdf --lowquality --enable-javascript --javascript-delay "5000" --enable-smart-shrinking --no-stop-slow-scripts "C:\Users\razaz\AppData\Local\Temp\knp_snappy5d807944516442.29719528.html" "C:\Users\razaz\AppData\Local\Temp\knp_snappy5d80794451ccb4.67360917.pdf".

Apparently it is a URL error and I've tried many solutions available over stack overflow but all in vain. My html page is as follows:

<!DOCTYPE html>
<html>
<head>
    <title>EDO Roster</title>
    <link rel="stylesheet" href="{{ URL::asset('css/app.css') }}">          
    <link href='{{ URL::asset('fullcalendar/packages/core/main.css') }}' rel='stylesheet' />
    <link href='{{ URL::asset('fullcalendar/packages/daygrid/main.css') }}' rel='stylesheet' />
</head>
<body>


    <div class="col-md-9 m-lg-5">
          <div class="box box-primary p-sm-4">
            <div class="box-body">
              <!-- THE CALENDAR -->
                <h3>EDO Roster</h3>

                  <hr>
                  <div id="calendar" ></div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /. box -->
        </div>

</body>
</html>
<script src="{{ URL::asset('fullcalendar/packages/core/main.js') }}"></script>
<script src="{{ URL::asset('fullcalendar/packages/interaction/main.js') }}"></script>
<script src="{{ URL::asset('fullcalendar/packages/daygrid/main.js') }}"></script>
<script src="{{ URL::asset('fullcalendar/packages/timegrid/main.js') }}"></script>
<script src="{{ URL::asset('js/jQuery.min.js') }}"></script>

<script>
$(document).ready(function() {
      var calendarEl = document.getElementById('calendar');
      var calendar = new FullCalendar.Calendar(calendarEl, {
          plugins: [ 'interaction', 'dayGrid', 'bootstrap', 'timeGrid' ],
          themeSystem: 'bootstrap',
           header: {
          left: false,
          center: 'title',
          },
          defaultView: 'dayGridMonth',
          validRange: {
            start: '2019-08-26',
            end: '2019-09-26',
          },   
          selectable: true,
          editable  : true,
          droppable : true,

          eventSources: [

            {
              url: '{{"roster/getEvents"}}',
              allDay: false,
              allDayMaintainDuration: false,
              textColor: 'black',

            },

            {
              url: '{{"roster/getGazette"}}',
              editable: false,
              id: 'a',
              overlap: false,
            },
          ],
        });

      calendar.render();
      });

</script>

I've tried giving it a hard coded URLs but is does not work as well. i am assuming that laravel-snappy doesn't load JS and CSS. kindly take a look at this and help me on this.

P.S: Any advise on html-to-pdf is highly appreciated.

Raza Zaidi
  • 520
  • 1
  • 3
  • 17

1 Answers1

2

Nobody answered the question so I kept working on it and I reduced the errors by replacing URL::asset with file:///complete-URL this way I got rid of the "failed to load errors" but still it was not loading the file so just to check deleted scripts from the page and it worked so the problem was in scripts which is absurd as laravel-snappy should have worked with javascript.

Now as the issue is no more relevant so I am closing this question.

Raza Zaidi
  • 520
  • 1
  • 3
  • 17