jeudi 19 mai 2016

Laravel - add the contents of an HTML file to the top of another one

I have a working HTML to PDF (wkhtmltopdf) working Laravel website, where the user has the ability to amend a "template" and then export it to a PDF. At the moment, I have had to encode the font to base64, as the apostrophes etc.. were being missed out. This in itself is a huge amount of code, something that I don't want saving in the database.

So, I have the following stored in a blade (style.blade.php) file (shortened for this example):

<style>
  @font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    src:url("data:font/ttf;base64,AAEAAAARAQAABAAQR1BPU792x2wAAS2AAAASSkdTVUKOOI56AAE/
                  zAAAAHBPUy8y2a6qaQAAyigAAABgY21hcIwYkAAAAMqIAAAAtGN2dCAG9xijAADScAAAAC5
                  mcGdtclpyQAAAyzwAAAblZ2FzcAASABgAAS10AAAADGdseWbADxfjAAABHAAAw2BoZWFk/

....

                  wABAAEAAmxpZ2EADmxpZ2EADgAAAAEAAAABAAQABAAAAAEACAABABoAAQAIAAIABgAMAN
                  YAAgBMANcAAgBPAAEAAQBJ") 
    format('truetype');
  }

  .page-break {
    page-break-after: always;
  }
</style>

I would like to "add" the entire contents of the file, to the top of another HTML file.

Any suggestions how I can do this would be greatly appreciated.

Many thanks.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1U205hW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire