Ensure that the page has been set to the correct dimensions in the controller. When loading the PDF View you can set the paper. Something along the lines of:
$pdf = PDF::loadView('folder-name.file-name')->setPaper('a4', 'portrait');
Also note that the container div of each page should be set to the same dimensions as the paper, you can set the width and height in mm to do this.
Since you cannot use tools like inspect element when viewing a PDF you are limited in how you can test and debug.
It is good to switch between HTML and PDF view (if possible) but if you can't do this, please note the following:
- Ensure you are always validating the HTML markup using W3C Validator - broken code can have adverse affects, not as forgiving as a browser!
- Some error messages received in the past have been related to PHP version so ensure that the environment is compatible
- Use HTML tables and code similar to how you would if you were creating an email build
- If a generated PDF may exceed more than one page, try to avoid nesting everything within one table otherwise, you may have situations where the entire page is skipped or even not loading at all