Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
  <main>
    <h1>L'interMEDIAire</h1>
    <h2>Titre 2</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam ipsam delectus sapiente officia temporibus quam dolorum nam iusto asperiores vitae, quia, ratione hic quod vel unde quae tempore a in.Earum sapiente cupiditate ducimus amet quo provident! Adipisci eaque ducimus incidunt tempora ipsa? Iusto, repellat aliquam reprehenderit fugit! Perspiciatis, reprehenderit quisquam excepturi!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum velit nam illo molestiae earum, distinctio recusandae omnis eius soluta. Saepe asperiores libero modi est eum rem aliquid dolorum laudantium magnam.</p>
    <br><br>
          <button onclick="goPDF('Merlin','Ipsum','29/01/2022')">Donwload on pdf</button>
  </main>
</body>
              
            
!

CSS

              
                /*COULEURS*/
$noir:        rgba(0,0,0,1);
$noirfonce:   rgba(29,31,32,1);
$noiropaque:  rgba(29,31,32,.9);
$rose:        rgba(152,38,114,1);
$bleu:        rgba(128,155,189,1);
$blanc:       rgba(255,255,255,1);
$gris:        rgba(55,55,55,1);
$gris2:       rgba(255,255,255,.8);
$gris3:       rgba(204,204,204,1);
$padding:     20px 10px;

/*TOUS LES ELEMENTS*/
*,*:after,*:before {
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

body {
  margin: 0px auto;
  width: 640px;
  background: $noir;
  color: $blanc;
  font-size: 1em;
  padding: $padding;
}

main {
  padding: $padding;
  background: $noirfonce;
}

a {
  color: $bleu;
  text-decoration: none;
  transition: all .3s ease-in-out;
}

a:hover,a:active {
  color: $blanc
}

h1 {
  margin: 0;
  padding: 0;
  font-size: 1.4em;
  color: $bleu;
}

h2 {
  margin-top: 15px;
  width: 100%;
  color: $rose;
}

h3 {
  display: inline-block;
  margin: 10px 0px;
  color: $gris2;
  text-transform: uppercase;
}

h1,h2,h3 {
  font-family: 'Inconsolata', monospace;
}

p {
  opacity: .85;
  color: $gris2;
  line-height: 1.6em;
}

ul {
  margin: 0;
  padding: 0;
  color: $gris3;
  list-style: none;
}

button {
  background: $noir;
  border: none;
  display: block;
  padding: 10px 15px;
  line-height: 150%;
  color: $blanc;
  cursor: pointer;
  &:hover,
  &:active {
    background: $rose;
  }
}
/*www.lintermediaire.be*/
              
            
!

JS

              
                function goPDF(prenom,nom,date) {

var dynamicContent = 'Par la présente, nous attestons que '+prenom+' '+nom+' est l\'auteur du site web lintermediaire.be.\n\nCet article a été publié le '+date+'.\n\n';

/*FONTS*/
pdfMake.fonts = {
  Roboto: {
    normal: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Regular.ttf',
    bold: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Medium.ttf',
    italics: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Italic.ttf',
    bolditalics: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-MediumItalic.ttf'
  }
};

pdfMake.createPdf({
  
 /* TEXT EN ARRIERE PLAN */
watermark: { text: 'L\'interMEDIAire', color: 'grey', opacity: 0.3, bold: true, italics: false, fontSize: 52,
},

/* BACKGROUND */
background: function (page) {
  if (page !== 2) {
    return [
    {
      image: 'lintermediaire',
    }
    ];
  }
},
images: {
        lintermediaire: 'https://picsum.photos/1280/80'
  /*
    lintermediaire: 'data:image/png;base64,!!!',
  */
},

/* TEXTS */
content: [
  
{ text: 'L\'interMEDIAire, le 29 janvier 2022.\n\n', style: 'right', margin: [40,60,40,20]},

{
  text: [
  '',
  { text: 'Concerne', bold: true, decoration: 'underline' },
  ' : Test de Make PDF js.\n\n'
  ],
  style: 'paragraf',margin: [40,0,40,0]
},

{
  text: [
  'Cette page a été rédigée par ',
  { text: ''+prenom+' '+nom+'', bold: true },
  '. La date de sa mise en ligne est le : ',
  { text: ''+date+'', bold: true },
  '.\n\n'
  ],
  style: 'paragraf',margin: [40, 10]
},

{ text: 'Réalisé par lintermediaire.be\n\n', style: 'right',  margin: [40,0,40,20]},

],

/* STYLES */
styles: {
  paragraf: {
    alignment: 'left'
  },

  right: {
    italics: true,
    alignment: 'right'
  }
}

})
.download('lintermediaire.pdf');
}
              
            
!
999px

Console