SHARE
TWEET

printhtml.c

Turpo-Urpo Jun 25th, 2020 1,603 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. #define rows 20
  6. #define linelength 50
  7.  
  8. int main(int argc, char **argv) {
  9.     char row[rows][linelength] = {
  10.         "<!DOCTYPE html>",
  11.         "<html>",
  12.         "   <head>",
  13.         "       <style>",
  14.         "           svg {",
  15.         "               fill:blue;",
  16.         "               stroke-width:5;",
  17.         "               fill-opacity:0.1;",
  18.         "               stroke-opacity:1.0;",
  19.         "               border: black;",
  20.         "               border-style: double;",
  21.         "               }",
  22.         "       </style>",
  23.         "   </head>",
  24.         "   <body>",
  25.         "       <svg width='290' height='190'>",
  26.         "           <rect x='20' y='20' width='250' height='150'/>",
  27.         "       </svg>",
  28.         "   </body>",
  29.         "</html>"};
  30.  
  31.     FILE * fp; fp = fopen ("c.html", "w+");
  32.     for (int i = 0; i < rows; i++) { fprintf(fp, "%s\n", row[i]); }
  33.     fclose(fp);
  34.     system("xdg-open file:///$HOME/c.html");
  35.     return 0;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top